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

when started with python3 it will not have dist-packages in sys.path, imports will fail #70

Open
prof7bit opened this issue Oct 30, 2016 · 1 comment

Comments

@prof7bit
Copy link

The following is observed on a Kubuntu Xenial PC:

Look at this session, i'm trying to import a module I have installed on this PC,
note how it is missing the dist-packages folders in the sys.path

Python 3.5.2 (default, Sep 10 2016, 08:21:44) 
[GCC 5.4.0 20160609] on linux
Type "copyright", "credits" or "license()" for more information.
DreamPie 1.2.1
>>> import hidapi
Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import hidapi
ImportError: No module named 'hidapi'
>>> import sys
>>> sys.path
0: ['',
 '/usr/share/dreampie/dreampielib/data',
 '/usr/lib/python35.zip',
 '/usr/lib/python3.5/',
 '/usr/lib/python3.5/plat-x86_64-linux-gnu',
 '/usr/lib/python3.5/lib-dynload']
>>> 

Below is the same session in a plain python3 console in the terminal,
note how there are two more folders for the dist-packages, I guess thats the reason why the import failed in the above session.

--(bernd@Saturn)-(/home/bernd)--
--($)-- python3 
Python 3.5.2 (default, Sep 10 2016, 08:21:44) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import hidapi
>>> import sys
>>> sys.path
['', '/usr/lib/python35.zip', '/usr/lib/python3.5', '/usr/lib/python3.5/plat-x86_64-linux-gnu', '/usr/lib/python3.5/lib-dynload', '/usr/local/lib/python3.5/dist-packages', '/usr/lib/python3/dist-packages']
>>> 

@bbayles
Copy link

bbayles commented Oct 30, 2016

Is it fixed on master? See this commit.

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

No branches or pull requests

2 participants