I am using pycharm for Python in Windows 10.
I have installed the package matplotlib.
I am using python 3.6 when i do import matplotlib there is no error.
However if i do matplotlib.pyplot as plt i am getting this following errors:
Traceback (most recent call last):
File "D:/Year4/เจคจบ/Project/ex/Image_manipulation_detection-master/demo_two_stream.py", line 9, in <module>
import matplotlib.pyplot as plt
File "C:\Users\Acer\AppData\Local\Programs\Python\Python36\lib\site-packages\matplotlib\__init__.py", line 110, in <module>
from matplotlib.rcsetup import validate_backend, cycler
File "C:\Users\Acer\AppData\Local\Programs\Python\Python36\lib\site-packages\matplotlib\rcsetup.py", line 28, in <module>
from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
File "C:\Users\Acer\AppData\Local\Programs\Python\Python36\lib\site-packages\matplotlib\fontconfig_pattern.py", line 15, in <module>
from pyparsing import (Literal, ZeroOrMore, Optional, Regex, StringEnd,
File "C:\Users\Acer\AppData\Local\Programs\Python\Python36\lib\site-packages\pyparsing\__init__.py", line 130, in <module>
__version__ = __version_info__.__version__
AttributeError: 'version_info' object has no attribute '__version__'
Related
while i try to run a matplotlib example program it shows "Failed to import numpy multicore array".Then i upgrade the numpy version from 1.12 to 1.15 on both the python versions 2.7 and 3.5(in raspberry pi python 2.7 is a default version).
The code am using is:
import matplotlib.pyplot as plt
plt.plot([1, 2, 3, 4])
plt.ylabel('some numbers')
plt.show()
while running this code it show some different error that
Traceback (most recent call last):
File "/home/pi/.local/lib/python3.5/site-packages/numpy/core/__init__.py", line 16, in <module>
from . import multiarray
ImportError: libf77blas.so.3: cannot open shared object file: No such file or directory
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/home/pi/hdg.py", line 1, in <module>
import matplotlib.pyplot as plt
File "/usr/local/lib/python3.5/dist-packages/matplotlib/__init__.py", line 141, in <module>
from . import cbook, rcsetup
File "/usr/local/lib/python3.5/dist-packages/matplotlib/cbook/__init__.py", line 33, in <module>
import numpy as np
File "/home/pi/.local/lib/python3.5/site-packages/numpy/__init__.py", line 142, in <module>
from . import add_newdocs
File "/home/pi/.local/lib/python3.5/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/home/pi/.local/lib/python3.5/site-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/home/pi/.local/lib/python3.5/site-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/home/pi/.local/lib/python3.5/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: libf77blas.so.3: cannot open shared object file: No such file or directory
how to overcome this one?
I'm trying to install Scipy through pip, but it won't work. It says that it already is installed, but when I try to import the modules it gives me errors.
from matplotlib import pyplot as plt
Error:
Traceback (most recent call last):
File "C:\Users\TimGF\Documents\Coding\Python\numpy.py", line 1, in <module>
from matplotlib import pyplot as plt
File "C:\Python36\lib\site-packages\matplotlib\__init__.py", line 127, in <module>
from . import cbook
File "C:\Python36\lib\site-packages\matplotlib\cbook\__init__.py", line 35, in <module>
import numpy as np
File "C:\Users\TimGF\Documents\Coding\Python\numpy.py", line 1, in <module>
from matplotlib import pyplot as plt
File "C:\Python36\lib\site-packages\matplotlib\pyplot.py", line 31, in <module>
import matplotlib.colorbar
File "C:\Python36\lib\site-packages\matplotlib\colorbar.py", line 32, in <module>
import matplotlib.artist as martist
File "C:\Python36\lib\site-packages\matplotlib\artist.py", line 15, in <module>
from . import cbook, docstring, rcParams
ImportError: cannot import name 'rcParams'
EDIT: It turned out, that the problem was, that I called my file "matplotlib.py".
Turned out that I was super stupid, and I just had to rename the python file to something else than "matplotlib.py" since it confused the script.
I have those errors when i'm trying to import the matplotlib.
How can i fix this?
I have install matplotlib with the pip install matplotlib and this was a succes.
But when i import the package i have this kind of error.
i see it is in the init block but how can i fix this?
i have already tried the pip matplotlib upgrade but this keeps the same problem.
i just have matplotlib uninstalled and back installed and it is the same problem.
My code:
import matplotlib.pyplot as plt
Error:
Traceback (most recent call last):
File "C:\Python27\TEST.py", line 1, in <module>
import matplotlib.pyplot as plt
File "C:\Python27\lib\site-packages\matplotlib\pyplot.py", line 26, in <module>
from matplotlib.figure import Figure, figaspect
File "C:\Python27\lib\site-packages\matplotlib\figure.py", line 24, in <module>
import matplotlib.artist as martist
File "C:\Python27\lib\site-packages\matplotlib\artist.py", line 7, in <module>
from transforms import Bbox, IdentityTransform, TransformedBbox, \
File "C:\Python27\lib\site-packages\matplotlib\transforms.py", line 35, in <module>
from matplotlib._path import (affine_transform, count_bboxes_overlapping_bbox,
ImportError: DLL load failed: %1 is geen geldige Win32-toepassing
I have tried another code, that I found in the comments. But this generate my another error code.
Code :
import matplotlib as mpl
mpl.use('TkAgg')
import matplotlib.pyplot as plt
Error:
Traceback (most recent call last):
File "C:\Python27\TEST.py", line 1, in <module>
import matplotlib as mpl
File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 1097, in <module>
rcParams = rc_params()
File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 933, in rc_params
fname = matplotlib_fname()
File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 781, in matplotlib_fname
for fname in gen_candidates():
File "C:\Python27\lib\site-packages\matplotlib\__init__.py", line 770, in gen_candidates
yield os.path.join(six.moves.getcwd(), 'matplotlibrc')
AttributeError: '_MovedItems' object has no attribute 'getcwd'
Error
Little test program
A "p" seems to be missing from "pyplot". You have pylot instead of pyplot in the import statement.
Have installed win 10 on my macbook for working with different plot libraries in python 3.4. I began vs Tkinter, but it is boring, so I followed some forums-speakers and tried matplotlib. I installed it using pip3 and get next error:
Traceback (most recent call last):
File "C:/Users/Gleb/PycharmProjects/_testing_plot_libraries_/matplotlib_trying.py", line 1, in <module>
import matplotlib.pyplot as plt
File "C:\Python34\lib\site-packages\matplotlib\__init__.py", line 124, in <module>
from matplotlib.rcsetup import (defaultParams,
File "C:\Python34\lib\site-packages\matplotlib\rcsetup.py", line 30, in <module>
from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
File "C:\Python34\lib\site-packages\matplotlib\fontconfig_pattern.py", line 25, in <module>
from pyparsing import Literal, ZeroOrMore, \
File "C:\Python34\lib\site-packages\pyparsing.py", line 2, in <module>
import matplotlib.pyplot as plt
File "C:\Python34\lib\site-packages\matplotlib\pyplot.py", line 29, in <module>
import matplotlib.colorbar
File "C:\Python34\lib\site-packages\matplotlib\colorbar.py", line 32, in <module>
import matplotlib.artist as martist
File "C:\Python34\lib\site-packages\matplotlib\artist.py", line 13, in <module>
from matplotlib import docstring, rcParams
ImportError: cannot import name 'rcParams'
in simple task:
import matplotlib.pyplot as plt
plt.plot([1,2,3])
plt.ylabel('some numbers')
plt.show()
what should I do to make it work?
can you give me some advises in plot libraries for science? Im looking for more 2D than 3D plotting libraries.
I'm trying to make a graph using matplotlib.pyplot and subprocess, but I get the following error:
Traceback (most recent call last):
File "subprocess.py", line 2, in <module>
import matplotlib.pyplot as plt
File "/usr/lib/pymodules/python2.7/matplotlib/__init__.py", line 105, in <module>
import os, re, shutil, subprocess, sys, warnings
File "/home/igor/Documentos/subprocess.py", line 2, in <module>
import matplotlib.pyplot as plt
File "/usr/lib/pymodules/python2.7/matplotlib/pyplot.py", line 20, in <module>
from matplotlib import _pylab_helpers, interactive
ImportError: cannot import name interactive
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 66, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python2.7/dist-packages/apport/__init__.py", line 1, in <module>
from apport.report import Report
File "/usr/lib/python2.7/dist-packages/apport/report.py", line 12, in <module>
import subprocess, tempfile, os.path, urllib, re, pwd, grp, os
File "/home/igor/Documentos/subprocess.py", line 2, in <module>
import matplotlib.pyplot as plt
File "/usr/lib/pymodules/python2.7/matplotlib/pyplot.py", line 20, in <module>
from matplotlib import _pylab_helpers, interactive
ImportError: cannot import name _pylab_helpers
If I try to do a graph not using subprocess (just plotting 2 arrays as axes), I don't get this problem.
Can someone help me?