unresolved references for local packages

hello,

 i have modules installed under the local user ( ~/.local)  and they are visible to the IDE. At the same time I can not import them in IDE - the IDE reports "unresolved reference"

 

And i:

 

 

 

the "Python Terminal" "sys.path also shows all the locally installed packages.

/usr/bin/python3.5 /home/az/apps/pycharm-community-2017.2/helpers/pydev/pydevconsole.py 45743 41119
PyDev console: starting.
import sys; print('Python %s on %s' % (sys.version, sys.platform))
sys.path.extend(['/home/az/work/NJA/Prjs/Test1'])
Python 3.5.3 (default, May 11 2017, 09:10:41)
[GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux
import cx_Oralce
Traceback (most recent call last):
  File "/usr/lib64/python3.5/code.py", line 91, in runcode
    exec(code, self.locals)
  File "<input>", line 1, in <module>
  File "/home/az/apps/pycharm-community-2017.2/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
ImportError: No module named 'cx_Oralce'
import cx_Oracle
print(sys.path)
['/home/az/apps/pycharm-community-2017.2/helpers/pydev', '/home/az/.local/lib/python3.5/site-packages/seaborn-0.8.1-py3.5.egg', '/home/az/.local/lib/python3.5/site-packages/jupyter-1.0.0-py3.5.egg', '/home/az/.local/lib/python3.5/site-packages/ipywidgets-7.0.0-py3.5.egg', '/home/az/.local/lib/python3.5/site-packages/ibapi-9.73.2-py3.5.egg', '/usr/lib/python3.5/site-packages/tws_async-0.5.5-py3.5.egg', '/usr/lib/python3.5/site-packages/seaborn-0.8.1-py3.5.egg', '/usr/lib/python3.5/site-packages/jupyter-1.0.0-py3.5.egg', '/usr/lib/python3.5/site-packages/ipywidgets-7.0.0-py3.5.egg', '/home/az/apps/pycharm-community-2017.2/helpers/pydev', '/usr/lib64/python35.zip', '/usr/lib64/python3.5', '/usr/lib64/python3.5/plat-linux', '/usr/lib64/python3.5/lib-dynload', '/home/az/.local/lib/python3.5/site-packages', '/usr/lib64/python3.5/site-packages', '/usr/lib/python3.5/site-packages', '/home/az/work/NJA/Prjs/Test1']

At the same time I can NOT import these locally installed packages. Only globally installed are available.

In the terminal :

LD_LIBRARY_PATH set to /home/az/TimesTen/tt1122/lib:/home/az/TimesTen/tt1122/ttoracle_home/instantclient_11_2:/home/az/apps/pycharm-community-2017.2/bin

PATH set to /home/az/TimesTen/tt1122/bin:/home/az/TimesTen/tt1122/quickstart/sample_code/oci:/home/az/TimesTen/tt1122/quickstart/sample_code/odbc:/home/az/TimesTen/tt1122/quickstart/sample_code/odbc/xla:/home/az/TimesTen/tt1122/quickstart/sample_code/jdbc:/home/az/TimesTen/tt1122/quickstart/sample_code/odbc_drivermgr:/home/az/TimesTen/tt1122/quickstart/sample_code/proc:/home/az/TimesTen/tt1122/quickstart/sample_code/ttclasses:/home/az/TimesTen/tt1122/quickstart/sample_code/ttclasses/xla:/home/az/TimesTen/tt1122/ttoracle_home/instantclient_11_2:/home/az/TimesTen/tt1122/ttoracle_home/instantclient_11_2/sdk:/home/az/TimesTen/tt1122/3rdparty/ant/bin:/usr/lib64/ccache:/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/home/az/.local/bin:/home/az/bin

CLASSPATH set to /home/az/TimesTen/tt1122/lib/ttjdbc5.jar:/home/az/TimesTen/tt1122/lib/orai18n.jar:/home/az/TimesTen/tt1122/lib/timestenjmsxla.jar:/home/az/TimesTen/tt1122/3rdparty/jms1.1/lib/jms.jar:.:/home/az/apps/pycharm-community-2017.2/lib/bootstrap.jar:/home/az/apps/pycharm-community-2017.2/lib/extensions.jar:/home/az/apps/pycharm-community-2017.2/lib/util.jar:/home/az/apps/pycharm-community-2017.2/lib/jdom.jar:/home/az/apps/pycharm-community-2017.2/lib/log4j.jar:/home/az/apps/pycharm-community-2017.2/lib/trove4j.jar:/home/az/apps/pycharm-community-2017.2/lib/jna.jar

[az@hp Test1]$
[az@hp Test1]$
[az@hp Test1]$ which python3
/usr/bin/python3
[az@hp Test1]$ ls -l /usr/bin/python3
lrwxrwxrwx. 1 root root 9 May 11 05:12 /usr/bin/python3 -> python3.5
[az@hp Test1]$ python3
Python 3.5.3 (default, May 11 2017, 09:10:41)
[GCC 6.3.1 20161221 (Red Hat 6.3.1-1)] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import cx_Oracle
>>> import math
>>> import ibapi
>>>

No issues with importing these libraries.

I also do not have a problem while executing python scripts with locally installed packages in either environment ( nor from IDE, nor from terminal etc).

 

 

 

 

 

 

 

0
Avatar
Permanently deleted user

i installed VisualCode and have no issues with the packages. Everything gets resolved correctly in VSC

0

请先登录再写评论。