python - Pycharm cannot import my modules while executing (the directory is present in the sources list and I can execute it just fine from the command line) -


it's throwing me error:

/usr/bin/python -u /opt/pycharm-community-4.5.1/helpers/pydev/pydev_run_in_console.py 58137 38816 /path/to/my/module.py /usr/lib/python/site-packages/ipython/external/path.py:32: deprecationwarning: md5 module deprecated; use hashlib instead   import sys, warnings, os, fnmatch, glob, shutil, codecs, md5 /usr/lib/python/site-packages/ipython/iplib.py:58: deprecationwarning: sets module deprecated   sets import set running /path/to/my/module.py traceback (most recent call last):   file "/opt/pycharm-community-4.5.1/helpers/pydev/pydev_run_in_console.py", line 69, in <module>     globals = run_file(file, none, none)   file "/opt/pycharm-community-4.5.1/helpers/pydev/pydev_run_in_console.py", line 29, in run_file     pydev_imports.execfile(file, globals, locals)  # execute script   file "/path/to/my/module.py", line 13, in <module>     import my.module.name importerror: no module named my.module.name  process finished exit code 1 couldn't connect console process. 

if run on bash terminal, it's executing fine. executing fine pycharm too, i'm not sure changed , started seeing happening. also, doesn't show errors missing module in editor, suggests @ least editor can see packages in path searches. pythonpath has directory.

removing pythonpath environment variables run fixed issue.

steps fix:

  1. run -> run...
  2. edit configurations
  3. select configuration run that's affected
  4. click on button labeled ... next environment variables text field
  5. remove pythonpath list of environment variables displayed there

i still don't understand happened, inspecting variable before removing showed same list of paths added several times. seemed odd, removed variable , tried, , worked!


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -