fiftyone icon indicating copy to clipboard operation
fiftyone copied to clipboard

[BUG] AttributeError: module 'fiftyone' has no attribute 'config'

Open kaixi-wang opened this issue 2 years ago • 2 comments

System information

  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): M1 Apple Silicon running Monterey (12.6)
  • FiftyOne installed from (pip or source): source
  • FiftyOne version (run fiftyone --version): FiftyOne v0.17.2, Voxel51, Inc.
  • Python version: Python 3.10.7

Commands to reproduce

As thoroughly as possible, please provide the Python and/or shell commands used to encounter the issue.

Install fiftyone via:

git clone https://github.com/voxel51/fiftyone
cd fiftyone
bash install.bash -d

Try to run the app:

# cli
fiftyone quickstart

or running .py file with:

import fiftyone as fo
import fiftyone.zoo as foz

dataset = foz.load_zoo_dataset("quickstart")
session = fo.launch_app(dataset)
session.wait()

Try to print the config:

fiftyone config

Describe the problem

Getting this AttributeError when trying to run the app and print the config:

AttributeError: module 'fiftyone' has no attribute 'config'

Fix

  1. install mongoDB for M1 following https://voxel51.com/docs/fiftyone/user_guide/config.html#configuring-a-mongodb-connection
  2. Create .fiftyone directory in the users home directory with a config.json file containing:
{
    "database_uri":"mongodb://localhost"
}
  1. Run pip install -e .
  2. Add fiftyone to $PYTHONPATH (eg export PYTHONPATH=$PYTHONPATH:~/Dev/voxel51/fiftyone)

kaixi-wang avatar Oct 11 '22 23:10 kaixi-wang

I don't think this a an m1 issue. This is a general issue related to editable installs and submodules. Perhaps this

benjaminpkane avatar Oct 12 '22 22:10 benjaminpkane

Yes to clarify, if you're not running an M1 mac, then your fix is just the second part:

pip install -e .
export PYTHONPATH=$PYTHONPATH:~/path/to/fiftyone

brimoor avatar Oct 13 '22 15:10 brimoor

I was running into the same issue when running python fiftyone/server/main.py . following the fix worked for me. Thank you! 🍨

manivoxel51 avatar Oct 28 '22 22:10 manivoxel51

Getting this error in python shell, specifically when accessing the zoo, e.g.: dataset = foz.load_zoo_dataset("quickstart")

Attempted the above fixes but they don't seem to address the issue.

Note that this is only from source installation. Pip installation fails on import of fiftyone with ValueError: Port must be an integer between 0 and 65535: 271017

ShawnOakley avatar Nov 01 '22 16:11 ShawnOakley

I've noticed that using ~ sometimes causes problems because it is read literally instead of being expanded. If you have the ~, you can try replacing it with the full path (ie /Users/<username>)

kaixi-wang avatar Nov 01 '22 17:11 kaixi-wang

Thanks! Think I got it, issue seems like it was due to conflicting env variables.

ShawnOakley avatar Nov 01 '22 17:11 ShawnOakley