Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
kaixi-wang opened this issue Oct 11, 2022 · 6 comments
Closed

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

kaixi-wang opened this issue Oct 11, 2022 · 6 comments
Labels
bug Bug fixes

Comments

@kaixi-wang
Copy link
Contributor

kaixi-wang commented Oct 11, 2022

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 kaixi-wang added the bug Bug fixes label Oct 11, 2022
@brimoor brimoor changed the title [SETUP-BUG] AttributeError when running quickstart on m1 mac after fresh install [SETUP-BUG] AttributeError: module 'fiftyone' has no attribute 'config' on M1 mac after fresh install Oct 12, 2022
@brimoor brimoor changed the title [SETUP-BUG] AttributeError: module 'fiftyone' has no attribute 'config' on M1 mac after fresh install [BUG] AttributeError: module 'fiftyone' has no attribute 'config' on M1 mac after fresh install Oct 12, 2022
@benjaminpkane
Copy link
Contributor

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

@brimoor brimoor changed the title [BUG] AttributeError: module 'fiftyone' has no attribute 'config' on M1 mac after fresh install [BUG] AttributeError: module 'fiftyone' has no attribute 'config' Oct 13, 2022
@brimoor
Copy link
Contributor

brimoor commented Oct 13, 2022

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

@manivoxel51
Copy link
Contributor

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

@ShawnOakley
Copy link
Contributor

ShawnOakley commented Nov 1, 2022

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

@kaixi-wang
Copy link
Contributor Author

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>)

@ShawnOakley
Copy link
Contributor

ShawnOakley commented Nov 1, 2022

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug fixes
Projects
None yet
Development

No branches or pull requests

6 participants