Have a compiled app that fails when multiarray attempts to import py31compat. It runs fine from source.
I am using Anaconda2-4.4.0-Windowsx86_64.exe (windows 7)
Using numpy-1.12.1, which was installed with pip
Compiling with py2exe script.
The error it gives is:
Traceback (most recent call last):
File "AutoFastener.py", line 23, in <module>
File "BatchControl\modBatchController.pyo", line 94, in <module>
File "FastenerDataSetUtilities\modFDDUtils.pyo", line 21, in <module>
File "scipy\__init__.pyo", line 61, in <module>
File "numpy\__init__.pyo", line 180, in <module>
File "numpy\add_newdocs.pyo", line 13, in <module>
File "numpy\lib\__init__.pyo", line 8, in <module>
File "numpy\lib\type_check.pyo", line 11, in <module>
File "numpy\core\__init__.pyo", line 23, in <module>
ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control). Otherwise reinstall numpy.
cannot import name py31compat
I've tried upgrading setuptools and distribute with pip, which did not help.
I've looked in the executables LIB file, and the pkg_resources has py31compat.pyo in it, which as far as I've been able to determine is where it should be.
I don't know how to figure out where the multiarray.pyd is trying to load it from.
Related
When I'm trying to install any package using PyCharm terminal, I always get this error.
(venv) C:\Users\Mi\Desktop\MAIN\Coding\python>pip install PyMySQL
Traceback (most recent call last):
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\Scripts\pip-script.py",
line 11, in <module>
load_entry_point('pip==19.0.3', 'console_scripts', 'pip')()
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\setupt
ools-40.8.0-py3.7.egg\pkg_resources\__init__.py", line 489, in load_entry_point
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\setupt
ools-40.8.0-py3.7.egg\pkg_resources\__init__.py", line 2793, in load_entry_point
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\setupt
ools-40.8.0-py3.7.egg\pkg_resources\__init__.py", line 2411, in load
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\setupt
ools-40.8.0-py3.7.egg\pkg_resources\__init__.py", line 2417, in resolve
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\pip-19
.0.3-py3.7.egg\pip\_internal\__init__.py", line 40, in <module>
from pip._internal.cli.autocompletion import autocomplete
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\pip-19
.0.3-py3.7.egg\pip\_internal\cli\autocompletion.py", line 8, in <module>
from pip._internal.cli.main_parser import create_main_parser
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\pip-19
.0.3-py3.7.egg\pip\_internal\cli\main_parser.py", line 12, in <module>
from pip._internal.commands import (
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\pip-19
.0.3-py3.7.egg\pip\_internal\commands\__init__.py", line 6, in <module>
from pip._internal.commands.completion import CompletionCommand
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\pip-19
.0.3-py3.7.egg\pip\_internal\commands\completion.py", line 6, in <module>
from pip._internal.cli.base_command import Command
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\pip-19
.0.3-py3.7.egg\pip\_internal\cli\base_command.py", line 20, in <module>
from pip._internal.download import PipSession
File "C:\Users\Mi\Desktop\MAIN\Coding\python\Coursera\venv\lib\site-packages\pip-19
.0.3-py3.7.egg\pip\_internal\download.py", line 6, in <module>
from json import json
ImportError: cannot import name 'json' from 'json' (C:\Users\Mi\Anaconda3\lib\json\__
init__.py)
But when I use pip install the library is installed, but it still doesn't work in PyCharm.
Thanks for help! And sorry for my english.
you can try to download corresponding pacages in '.tar.gz' format on this link
manually unzip it
enter the unzipped folder
install the package through the following cmd command:
python setup.py install
here I suppose you are using windows and your python is above 3
If you are continuously encontering this problem,I suggest you alter the original download channel to a mirror.
If you installed the library through terminal and Pycharm still doesn't recognize the library, I think may be you should select the correct interpreter for the project by clicking the project interpreter at the bottom right in a Pycharm project. Look at the image in this
link. Click on the Interpreter which is named just "Python 3.x", it may work then.
["3.x" as in which version of python you are using]
When I run a script in Anaconda Prompt, it works fine.
When I try to run it via PyCharm, I get this error related to the import of pandas.
C:\ProgramData\Anaconda3\python.exe C:/Users/MYUSERNAME/PycharmProjects/CARA/DocumentAccessCheck.py
Traceback (most recent call last):
File "C:/Users/MYUSERNAME/PycharmProjects/CARA/DocumentAccessCheck.py", line 2, in <module>
import pandas as pd
File "C:\ProgramData\Anaconda3\lib\site-packages\pandas\__init__.py", line 19, in <module>
"Missing required dependencies {0}".format(missing_dependencies))
ImportError: Missing required dependencies ['numpy']
Process finished with exit code 1
If I try to import numpy and run it via PyCharm I get:
C:\ProgramData\Anaconda3\python.exe C:/Users/MYUSERNAME/PycharmProjects/CARA/DocumentAccessCheck.py
Traceback (most recent call last):
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\__init__.py", line 16, in <module>
from . import multiarray
ImportError: DLL load failed: The specified module could not be found.
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:/Users/MYUSERNAME/PycharmProjects/CARA/DocumentAccessCheck.py", line 2, in <module>
import numpy as np
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\__init__.py", line 142, in <module>
from . import add_newdocs
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\lib\__init__.py", line 8, in <module>
from .type_check import *
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\lib\type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "C:\ProgramData\Anaconda3\lib\site-packages\numpy\core\__init__.py", line 26, in <module>
raise ImportError(msg)
ImportError:
Importing the multiarray numpy extension module failed. Most
likely you are trying to import a failed build of numpy.
If you're working with a numpy git repo, try `git clean -xdf` (removes all
files not under version control). Otherwise reinstall numpy.
Original error was: DLL load failed: The specified module could not be found.
Process finished with exit code 1
Running the same script in Anaconda prompt...no problem
My run configuration in PyCharm uses the Anaconda python distribution?
It should be noted that I am not using envirnoments, just the base Anaconda installation. More worryingly I dont see ANY Conda options in the project settings in PyCharm which a lot of tutorials seem to allude to.
Seems like a problem with the path for your scripts. Are you sure You have included your scripts in the PATH variable? If so are you sure your libraries are downloading/installing in that path?
I am trying to use tensorflow for research in my macbook. I use pip3 to install tensorflow in the system (not in virtual environment).
At first, I just want to verify tensorflow can be correctly imported via python3 in terminal. However, sometimes, I got the following problem when importing.
>>>import tensorflow as tf
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/cyan/Library/Python/3.5/lib/python/site-packages/tensorflow/__init__.py", line 24, in <module>
from tensorflow.python import pywrap_tensorflow # pylint: disable=unused-import
File "/Users/cyan/Library/Python/3.5/lib/python/site-packages/tensorflow/python/__init__.py", line 47, in <module>
import numpy as np
File "/Library/Python/2.7/site-packages/numpy/__init__.py", line 142, in <module>
from . import add_newdocs
File "/Library/Python/2.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/Library/Python/2.7/site-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/Library/Python/2.7/site-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/Library/Python/2.7/site-packages/numpy/core/__init__.py", line 14, in <module>
from . import multiarray
ImportError: dlopen(/Library/Python/2.7/site-packages/numpy/core/multiarray.so, 2): Symbol not found: _PyBuffer_Type
Referenced from: /Library/Python/2.7/site-packages/numpy/core/multiarray.so
Expected in: flat namespace in /Library/Python/2.7/site-packages/numpy/core/multiarray.so
This error could only be solved if I ran the following code firstly before python3 execution
unset PYTHONPATH
If I didn't unset PYTHONPATH, I also found errors when checking the version of pip3 using
pip3 --version
The errors are shown as follows.
>> pip3 --version
Traceback (most recent call last):
File "/usr/local/bin/pip3", line 6, in <module>
from pip._internal import main
File "/Library/Python/2.7/site-packages/pip/_internal/__init__.py", line 19, in <module>
from pip._vendor.urllib3.exceptions import DependencyWarning
File "/Library/Python/2.7/site-packages/pip/_vendor/urllib3/__init__.py", line 8, in <module>
from .connectionpool import (
File "/Library/Python/2.7/site-packages/pip/_vendor/urllib3/connectionpool.py", line 11, in <module>
from .exceptions import (
File "/Library/Python/2.7/site-packages/pip/_vendor/urllib3/exceptions.py", line 2, in <module>
from .packages.six.moves.http_client import (
File "/Library/Python/2.7/site-packages/pip/_vendor/urllib3/packages/six.py", line 203, in load_module
mod = mod._resolve()
File "/Library/Python/2.7/site-packages/pip/_vendor/urllib3/packages/six.py", line 115, in _resolve
return _import_module(self.mod)
File "/Library/Python/2.7/site-packages/pip/_vendor/urllib3/packages/six.py", line 82, in _import_module
__import__(name)
File "/Library/Python/2.7/site-packages/http/__init__.py", line 7, in <module>
raise ImportError('This package should not be accessible on Python 3. '
ImportError: This package should not be accessible on Python 3. Either you are trying to run from the python-future src folder or your installation of python-future is corrupted.
I thought it was so inconvenient to unset PYTHONPATH every time, so is there any solutions for this problem? I also want to import tensorflow in other text editor, such as Sublime and Pycharm, so I was really not sure what to do next.
I tried the same scenario. It is working fine for me. In the first error it seems your python installation is messed up. If you are using python3 in terminal, it should not refer to 2.7 libraries.
Also I dont think you require unset PYTHONPATH everytime. First thing is you dont need to setup PYTHONPATH. It seems the installation got issue.
You using homebrew in mac to install packages. If not I will say use homebrew and it will work as charm. As it adds dependency properly.
Thanks,
Ashish
I'm currently following the Scrapy tutorial and am at the step where there's a creation of a project, however this error is produced everytime I run the command scrapy startproject tutorial.
Error:
Traceback (most recent call last):
File "C:\Users\Me\Miniconda3\Scripts\scrapy-script.py", line 10, in <module>
sys.exit(execute())
File "C:\Users\Me\Miniconda3\lib\site-packages\scrapy\cmdline.py", line 149, in execute
cmd.crawler_process = CrawlerProcess(settings)
File "C:\Users\Me\Miniconda3\lib\site-packages\scrapy\crawler.py", line 252, in __init__
log_scrapy_info(self.settings)
File "C:\Users\Me\Miniconda3\lib\site-packages\scrapy\utils\log.py", line 149, in log_scrapy_info
for name, version in scrapy_components_versions()
File "C:\Users\Me\Miniconda3\lib\site-packages\scrapy\utils\versions.py", line 35, in scrapy_components_versions
("pyOpenSSL", _get_openssl_version()),
File "C:\Users\Me\Miniconda3\lib\site-packages\scrapy\utils\versions.py", line 43, in _get_openssl_version
import OpenSSL
File "C:\Users\Me\Miniconda3\lib\site-packages\OpenSSL\__init__.py", line 8, in <module>
from OpenSSL import crypto, SSL
File "C:\Users\Me\Miniconda3\lib\site-packages\OpenSSL\crypto.py", line 16, in <module>
from OpenSSL._util import (
File "C:\Users\Me\Miniconda3\lib\site-packages\OpenSSL\_util.py", line 6, in <module>
from cryptography.hazmat.bindings.openssl.binding import Binding
File "C:\Users\Me\Miniconda3\lib\site-packages\cryptography\hazmat\bindings\openssl\binding.py", line 13, in <module>
from cryptography.hazmat.bindings._openssl import ffi, lib
ImportError: DLL load failed: The specified procedure could not be found.
I suspected that the issue is in my installation of Scrapy, so I tried reinstalling Scrapy(first via pip then conda) but it still doesn't fix the problem. I then tried to install the packages that Scrapy needed(one by one) but it's still not fixing anything.
How do I go about fixing this?
Can you try to install Win64OpenSSL_Light-1_0_2h and reinstall cryptography?
pip install -I cryptography
See this existing answer.
I am trying to compile a python script for visualization of protein molecules using py2exe module. I've python2.7 running in win7 x64. When I try to execute the compiled file, it gives this error:-
C:\Python27\dist>visualn.exe
Traceback (most recent call last):
File "visualn.py", line 19, in <module>
File "MMTK\__init__.pyc", line 39, in <module>
File "Scientific\Geometry\__init__.pyc", line 30, in <module>
File "Scientific\Geometry\VectorModule.pyc", line 9, in <module>
File "Scientific\N.pyc", line 1, in <module>
ImportError: No module named Scientific_numerics_package_id
Without compiling I can run the script successfully. I've already installed scientific,MMTK modules. I got somewhere in the internet that Scientific_numerics_package_id module is available in netCDF4, so I installed that also but no good.
Any idea about the error?
You need the python-netcdf package.