fiftyone
fiftyone copied to clipboard
[BUG] AttributeError: module 'fiftyone' has no attribute 'config'
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
- install mongoDB for M1 following https://voxel51.com/docs/fiftyone/user_guide/config.html#configuring-a-mongodb-connection
- Create
.fiftyone
directory in the users home directory with aconfig.json
file containing:
{
"database_uri":"mongodb://localhost"
}
- Run
pip install -e .
- Add fiftyone to
$PYTHONPATH
(egexport PYTHONPATH=$PYTHONPATH:~/Dev/voxel51/fiftyone
)
I don't think this a an m1 issue. This is a general issue related to editable installs and submodules. Perhaps this
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
I was running into the same issue when running python fiftyone/server/main.py
. following the fix worked for me. Thank you! 🍨
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
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>
)
Thanks! Think I got it, issue seems like it was due to conflicting env variables.