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

ModuleNotFoundError: No module named 'examples'. #28

Closed
nevertiree opened this issue Apr 12, 2019 · 3 comments

Comments

@nevertiree
Copy link

commented Apr 12, 2019

When I follow the instruction and run "python examples/server_example.py" on folder ffai/ , I got ModuleNotFoundError: No module named 'examples'.

There may be some python import bugs here. When I move the example script to other directory and remove "examples" in import lines, this script can run successfully.

Thanks.

@njustesen njustesen closed this in 3e909bc Apr 12, 2019
@greentec

This comment has been minimized.

Copy link
Contributor

commented Jun 27, 2019

I experienced same issue.
I copied two files - 'scripted_bot_example.py' and 'grodbot.py' to parent directory, and remove examples from import sentence, then it worked.

@p-d-moore

This comment has been minimized.

Copy link
Contributor

commented Jun 27, 2019

If you are using conda for package management, rather than install ffai as a module, an alternative is to add the path of the project to your environment. A simple way to do this:

  1. open anaconda prompt
  2. activate conda_env (whichever environment you created to run ffai under)
  3. conda install conda-build
  4. conda-develop path_to_ffai (whever your ffai code folder sits)

Once you do this, imports relative to the root directory of your ffai project work just fine (within the conda environment of the project) whether you use vscode, pycharm, jupyter notebook or whatever. Incidentally, to use pycharm, I usually find it's best to launch from a fully activated conda environment (i.e. run the executable from an anaconda prompt) rather than to run the executable / shortcut directly.

@greentec

This comment has been minimized.

Copy link
Contributor

commented Jul 14, 2019

Some add: After actually entering conda_env, I was able to add the path through the conda develop [PATH] command rather than conda-develop [PATH]. OS: windows 10, conda version: 4.3.30

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.