importerror

Python: is the current directory automatically included in path?

 ̄綄美尐妖づ 提交于 2019-12-22 03:52:58
问题 Python 3.4: From reading some other SO questions it seems that if a moduleName.py file is outside of your current directory, if you want to import it you must add it to the path with sys.path.insert(0, '/path/to/application/app/folder') , otherwise an import moduelName statement results in this error: ImportError: No module named moduleName Does this imply that python automatically adds all other .py files in the same directory to the path? What's going on underneath the surface that allows

ImportError: No module named lib. Unable to import pandas, numpy, scipy, matplotlib

心不动则不痛 提交于 2019-12-22 00:05:07
问题 I recently updated a number of packages and my version of EPD Canopy (to1.4.1.1975) and now I'm unable to import pandas , numpy , scipy or matplotlib . I get the ImportError below. I've also tried importing from the command prompt but I can the same error. pandas - 0.14.0-1 numpy - 1.8.0-2 scipy - 0.14.0-1 matplotlib - 1.3.1-8 Does anybody have any suggestions as to how I could fix this? From this Stackoverflow question it seems like I might need to change/move something to a different

Issue when imoporting GDAL : ImportError, Library not loaded, Image not found

 ̄綄美尐妖づ 提交于 2019-12-21 17:05:09
问题 Since yesterday I struggle to import some libraries such as GDAL (or iris) and I allways get the same type of outputs. >>> import gdal Traceback (most recent call last): File "<stdin>", line 1, in <module> File "gdal.py", line 28, in <module> _gdal = swig_import_helper() File "gdal.py", line 24, in swig_import_helper _mod = imp.load_module('_gdal', fp, pathname, description) ImportError: dlopen(./_gdal.so, 2): Library not loaded: @rpath/libicui18n.56.dylib Referenced from: /Users/zoran

Alternatives to imp.find_module?

[亡魂溺海] 提交于 2019-12-21 16:54:35
问题 Background I've grown tired of the issue with pylint not being able to import files when you use namespace packages and divide your code-base into separate folders. As such I started digging into the astNG source-code which has been identified as the source of the trouble (see bugreport 8796 on astng). At the heart of the issue seems to be the use of pythons own imp.find_module in the process of finding imports. What happens is that the import's first (sub)package - a in import a.b.c - is fed

setting import module path in Jython - strange behavior

半世苍凉 提交于 2019-12-21 05:20:05
问题 I'm building Java to Jython bridge class. The task I'm trying to solve is to make Jython to look for python modules in my application working directory (also known as program execution directory). I'm doing so by appending System.getProperty("user.dir") value to the sys.path: pySysState = new PySystemState(); //add working directory into sys.path pySysState.path.append(new PyString(System.getProperty("user.dir"))); log_.info("Jython sys state initialized. sys.path: " + this.pySysState.path);

NumPy library ImportError: DLL load failed: The specified procedure could not be found

丶灬走出姿态 提交于 2019-12-21 04:49:31
问题 I'm learning python using Visual Studio 2017 on Windows 10. When I'm trying to import NumPy library into my code, this error appears. I have tried uninstalling and reinstalling, looking for libiomp5md.dll per instruction in ImportError: DLL load failed when importing Numpy installed in conda virtual environment but to no prevail. Traceback (most recent call last): File "C:\Program Files\Python36\lib\site-packages\numpy\core\__init__.py", line 16, in <module> from . import multiarray

cx_Oracle - DLL load failed

喜欢而已 提交于 2019-12-21 04:09:00
问题 I have a problem importing cx_Oracle with Python. I know a lot of issues with cx_Oracle have been discussed here, but it seems that I cannot find a solution to my problem after reading all the related topics. I have two machines, one is my computer and another one is a remote workstation, which have similar configs (Windows 7, 64-bits). I need to install cx_Oracle on the remote workstation but it does not work, whereas it works fine on my computer (I can import the module successfully and

“no module named PyPDF2” error

偶尔善良 提交于 2019-12-21 03:25:09
问题 I use Spyder, with Python 2.7, on a windows 10. I was able to install the PyPDF2 package with a conda command from my prompt. I said installation complete. Yet, If I try to run a simple import command: import PyPDF2 I get the error: ImportError: No module named PyPDF2 How can I fix this? 回答1: If you use python3 maybe apt-get install python3-pypdf2 回答2: In my case, I was trying to import 'pyPdf2' instead of 'PyPDF2'. Observe the case. import PyPDF2 is correct. 回答3: I faced the same problem.

ImportError: cannot import name array, when importing urllib2

旧城冷巷雨未停 提交于 2019-12-20 03:24:08
问题 I am getting below error when trying to import the urllib2: >>> import urllib2 Traceback (most recent call last): File "<stdin>", line 1, in <module> File "/usr/lib64/python2.7/urllib2.py", line 94, in <module> import httplib File "/usr/lib64/python2.7/httplib.py", line 69, in <module> from array import array ImportError: cannot import name array` Any thoughts on it? 回答1: It seems you have a python program named "array.py" in you present working directory. If yes rename that python program or

ImportError: cannot import name namedtuple

一曲冷凌霜 提交于 2019-12-19 18:52:26
问题 I have a python script that produces the following error when run: import urllib2 File "C:\Python27\lib\urllib2.py", line 94, in <module> import httplib File "C:\Python27\lib\httplib.py", line 73, in <module> from urlparse import urlsplit File "C:\Python27\lib\urlparse.py", line 119, in <module> from collections import namedtuple ImportError: cannot import name namedtuple I also use the openpyxl package, located in C:\Python27\Lib\site-packages, which contains a collections folder with a _