I have installed matplotlib from
http://matplotlib.org/downloads.html
I tried to get to the first step
c:\Python34\Scripts>py Example_01.py
Traceback (most recent call last):
File "Example_01.py", line 2, in <module>
import matplotlib.pyplot as plt
File "C:\Python34\lib\site-packages\matplotlib\__init__.py", line 105, in <mod
ule>
import six
ImportError: No module named 'six'
Using this site, I found advice that I should run setup.py. I found versions of setup.py in C:\Python34\Lib\site-packages\numpy but not in C:\Python34\Lib\site-packages\matplotlib.
So, my question would be:
Should I have a setup.py in the site-packages\matplotlib
Should there be a separate setup.py for each site package?
How would Python know which to run...both numpy and matplotlib can be imports.
Related
i would like to use opencv and tried to install the needed modules.
i need to install everything manually per donwload and then pip or install.
I am using Python 3.10.1 and Pip 21.2.4.
My project is an an venv.
The Following Modules are installed:
altgraph==0.17.2
cmake # file:///C:/Users/User/Python/modules/cmake-3.22.1-py2.py3-none-win_amd64.whl
cycler # file:///C:/Users/User/Python/modules/cycler-0.11.0-py3-none-any.whl
Cython # file:///C:/Users/User/Python/modules/Cython-3.0.0a9-cp310-cp310-win_amd64.whl
fonttools # file:///C:/Users/User/Python/modules/fonttools-4.29.0-py3-none-any.whl
future==0.18.2
kiwisolver # file:///C:/Users/User/Python/modules/kiwisolver-1.3.2-cp310-cp310-win_amd64.whl
matplotlib # file:///C:/Users/User/Python/modules/matplotlib-3.5.1-cp310-cp310-win_amd64.whl
numpy # file:///C:/Users/User/Python/modules/numpy-1.22.1-cp310-cp310-win_amd64.whl
opencv-python # file:///C:/Users/User/Python/modules/opencv_python-4.5.5-cp310-cp310-win_amd64.whl
packaging==21.3
paho-mqtt==1.6.1
pefile==2021.9.3
Pillow # file:///C:/Users/User/Python/modules/Pillow-9.0.0-cp310-cp310-win_amd64.whl
pyinstaller==5.0.dev0
pyinstaller-hooks-contrib==2021.5
pyparsing==3.0.7
python-dateutil # file:///C:/Users/User/Python/modules/python_dateutil-2.8.2-py2.py3-none-any.whl
pywin32-ctypes==0.2.0
scikit-build==0.12.0
six # file:///C:/Users/User/Python/modules/six-1.16.0-py2.py3-none-any.whl
i use a minimal script to check the import :
import sys
sys.path.append('C:\\Users\\User\\Python\\modules\\numpy-1.22.1-cp310-cp310-win_amd64.whl')
sys.path.append('c:\\users\\User\\python\\pyproj\\project1\\lib\\site-packages')
#import matplotlib
import numpy as np
that is the error:
Traceback (most recent call last):
File "C:\Users\User\Python\modules\numpy-1.22.1-cp310-cp310-win_amd64.whl\numpy\core\__init__.py", line 23, in <module>
from . import multiarray
File "C:\Users\User\Python\modules\numpy-1.22.1-cp310-cp310-win_amd64.whl\numpy\core\multiarray.py", line 10, in <module>
from . import overrides
File "C:\Users\User\Python\modules\numpy-1.22.1-cp310-cp310-win_amd64.whl\numpy\core\overrides.py", line 6, in <module>
from numpy.core._multiarray_umath import (
ModuleNotFoundError: No module named 'numpy.core._multiarray_umath'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "C:\Users\User\Python\pyproj\project1\import.py", line 6, in <module>
import numpy as np
File "C:\Users\User\Python\modules\numpy-1.22.1-cp310-cp310-win_amd64.whl\numpy\__init__.py", line 144, in <module>
from . import core
File "C:\Users\User\Python\modules\numpy-1.22.1-cp310-cp310-win_amd64.whl\numpy\core\__init__.py", line 49, in <module>
raise ImportError(msg)
ImportError:
IMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.10 from "C:\Users\User\Python\pyver\python3101\python.exe"
* The NumPy version is: "1.22.1"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: No module named 'numpy.core._multiarray_umath'
i am new in python and i cant find the problem.
Greetings
Chorum
Addition:
with
import os
print("PYTHONPATH:", os.environ.get('PYTHONPATH'))
print("PATH:", os.environ.get('PATH'))
i get:
PYTHONPATH: None
PATH: C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\imc\Shared;C:\Program Files (x86)\imc\shared;C:\Program Files\dotnet\;C:\Users\User\AppData\Local\Microsoft\WindowsApps;C:\SYSTEM\TNG
python is working fine. i used following modules before:
sys
tkinter
ctypes
time
I'm trying to install SMOP on Anaconda3 (Python 3.5.1), but it fails due to the following error:
[Anaconda3] C:\Users\IanHacker\Downloads\smop-0.29>python setup.py install
Traceback (most recent call last):
File "setup.py", line 4, in <module>
from smop.version import __version__
File "C:\Users\IanHacker\Downloads\smop-0.29\smop\__init__.py", line 4, in <module>
import version
ImportError: No module named 'version'
"pip install smop" and "easy_install smop" return the same error.
I referred to ImportError: No module named 'version', so I changed the content of __init__.py:
import version
import parse,resolve,backend,main
from version import __version__
to:
__version__ = '0.29'
import parse,resolve,backend,main
... then, I got:
[Anaconda3] C:\Users\IanHacker\Downloads\smop-0.29>python setup.py install
Traceback (most recent call last):
File "setup.py", line 4, in <module>
from smop.version import __version__
File "C:\Users\IanHacker\Downloads\smop-0.29\smop\__init__.py", line 6, in <module>
import parse,resolve,backend,main
ImportError: No module named 'parse'
I don't even know if the __version__ issue has been solved.
Even if it has been solved, I don't know what to replace "parse" with.
And ... do I have to keep replacing until this works? Is there any better way to solve this?
*For those who installed Anaconda, could you try to run the command and check if the same error happens? Am I the only one who gets this error?
I'm going through the API tutorial on New Coder (this one) and got the following error when I try to run the program:
RuntimeError: module compiled against API version 0xa but this version of numpy is 0x9Traceback (most recent call last):
File "api.py", line 7, in <module>
import matplotlib.pyplot as plt
File "/home/crash/TestEnv/venv/local/lib/python2.7/site-packages/matplotlib/pyplot.py", line 27, in <module>
import matplotlib.colorbar
File "/home/crash/TestEnv/venv/local/lib/python2.7/site-packages/matplotlib/colorbar.py", line 32, in <module>
import matplotlib.artist as martist
File "/home/crash/TestEnv/venv/local/lib/python2.7/site-packages/matplotlib/artist.py", line 12, in <module>
from .transforms import Bbox, IdentityTransform, TransformedBbox, \
File "/home/crash/TestEnv/venv/local/lib/python2.7/site-packages/matplotlib/transforms.py", line 39, in <module>
from matplotlib._path import (affine_transform, count_bboxes_overlapping_bbox,
ImportError: numpy.core.multiarray failed to import
I know it isn't my code because I tried running it with the example code too and had the same issue. One answer I saw suggested on here was to try Numpy 1.8, but that didn't work either.
Also, all of this is set up within a virtual environment as directed so I don't think it's an issue of what I have installed elsewhere.
Installing packets from file with requirements may cause failures. I mean something like pip install -r requirements.txt
It seems to me that pip just installs packets in order without dependencies (first line from file, second line, ...).
I had same issue because of having installed numpy outside of environment and numpy after matplotlib in requirements.txt Pip compiled matplotlib with system nympy, after that it installed new numpy and nothing worked.
I just have switched strings and set matplotlib after numpy. Now it works.
Try this:
pip install numpy --upgrade
It works for me
The full error:
import matplotlib
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import matplotlib
File "R:\Python34\lib\site-packages\matplotlib\__init__.py", line 180, in <module>
from matplotlib.cbook import is_string_like
File "R:\Python34\lib\site-packages\matplotlib\cbook.py", line 34, in <module>
import numpy.ma as ma
ImportError: No module named 'numpy.ma'
numpy is imported normally.
How do I install numpy.ma?
I also faced the same situation today. I found that I had saved a file as numpy.py, so check the filenames in your folder.
Re-install the correct version of numpy.
download correct .whl file from http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy
pip install C:\Path\To\Wheel\Filename.whl # for example: numpy-1.9.2+mkl-cp34-none-win_amd64.whl
Use Your (via terminal) package manager and search.
Example on Ubuntu:
aptitude search numpy
and install package.
In my case:
apt-get install python-numpy
I am using python 3.3 on Windows. I downloaded scipy-0.13.2.win32-py3.3.exe from scipy-lib and installed it. However, when I tried to load scipy.linalg, interpreter displayed the following errors:
>>> import scipy.linalg
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import scipy.linalg
File "C:\Python33\lib\site-packages\scipy\linalg\__init__.py", line 157, in <module>
from .misc import *
File "C:\Python33\lib\site-packages\scipy\linalg\misc.py", line 5, in <module>
from . import blas
File "C:\Python33\lib\site-packages\scipy\linalg\blas.py", line 131, in <module>
from scipy.linalg import _fblas
ImportError: DLL load failed: The specified module could not be found.
How can I resolve this issue? Between, I checked installed library modules on my PC with the github modules at linealg-scipy and they are latest, so no issue there, I guess.
To fix this issue in both Python 2.7/3, you can install scipy from here
It will work better than the version from this deposit.