I am working in Eclipse on Mac. I am using PyDev version 2.6.0.2012062818. I have a program that was running perfectly, but after I updated my Lion OS to Mountain Lion OS I have the following error while running:
Traceback (most recent call last):
File "/Users/Mihails/Projects/memsim/src/memsim/memsim.py", line 7, in <module>
from simulation import SimulationHP
File "/Users/Mihails/Projects/memsim/src/memsim/simulation.py", line 9, in <module>
import matplotlib.pyplot as plt
File "/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/pyplot.py", line 95, in <module>
new_figure_manager, draw_if_interactive, _show = pylab_setup()
File "/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/backends/__init__.py", line 25, in pylab_setup
globals(),locals(),[backend_name])
File "/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/backends/backend_wxagg.py", line 23, in <module>
import backend_wx # already uses wxversion.ensureMinimal('2.8')
File "/Library/Frameworks/Python.framework/Versions/7.3/lib/python2.7/site-packages/matplotlib/backends/backend_wx.py", line 63, in <module>
backend_version = wx.VERSION_STRING
AttributeError: 'module' object has no attribute 'VERSION_STRING'
I don't understand wx module at all. I don't have wx folder in site-packages. I have wxPython. wxPython init.py file :
# The "old" wxPython package
import warnings
warnings.warn(
"The wxPython compatibility package is no longer automatically generated "
"or actively maintained. Please switch to the wx package as soon as possible.",
DeprecationWarning, stacklevel=2)
# We need to be able to import from the wx package, but there is also
# a wxPython.wx module and that would normally be chosen first by
# import statements. So instead we'll have a wxPython._wx module and
# then stuff it into sys.modules with a wxPython.wx alias so old
# programs will still work.
import _wx
import sys
sys.modules['wxPython.wx'] = _wx
wx = _wx
del sys
from wx import __version__
I think when you update, some files have been replaced.
On Ubuntu 11.04 wx.VERSION_STRING, return string value.
Try reinstall WX, or append the 'VERSION_STRING', to WX main file.
I have experienced similar problem just now. I am working on Winodws and MacOSX.
Today when I excute my python program that use matplotlib and wx, it just pops out that message.
I fixed by:
1. I uninstalled the wx through pip;
2. install wxpython;
3. update matplotlib from 1.2.0 to 1.2.1;
I guess the problem is the package wxI installed from pip is not wx at all and it override my wxpython import somehow.
Hope this information could give you some hint on your problem as well as others.
Related
Traceback (most recent call last):
File "g:\mydrive\ \pdftotext_pdfminer.py", line 3, in <module>
from pdfminer.pdfinterp import PDFResourceManager, PDFPageInterpreter
File "C:\Users\ \anaconda3\envs\ \lib\site-packages\pdfminer\pdfinterp.py", line 7, in <module>
from .cmapdb import CMap
File "C:\Users\ \anaconda3\envs\ \lib\site-packages\pdfminer\encodingdb.py", line 7, in <module>
from .psparser import PSLiteral
File "C:\Users\ \anaconda3\envs\ \lib\site-packages\pdfminer\psparser.py", line 22, in <module>
from .utils import choplist
File "C:\Users\ \anaconda3\envs\ \lib\site-packages\pdfminer\utils.py", line 31, in <module>
import charset_normalizer # For str encoding detection
File "C:\Users\ \anaconda3\envs\ \lib\site-packages\charset_normalizer\__init__.py", line 23, in <module>
from charset_normalizer.api import from_fp, from_path, from_bytes, normalize
File "C:\Users\ \anaconda3\envs\ \lib\site-packages\charset_normalizer\api.py", line 10, in <module>
from charset_normalizer.md import mess_ratio
File "charset_normalizer\md.py", line 5, in <module>
ImportError: cannot import name 'COMMON_SAFE_ASCII_CHARACTERS' from 'charset_normalizer.constant' (C:\Users\ \anaconda3\envs\ \lib\site-packages\charset_normalizer\constant.py)
This error happens whenever I'm using pdfminer. I also installed pdfminer-six
My code worked just fine until two days ago.
It started to happen today when I tried to just run it again without any adjustment in the file
I'm assuming maybe it's the pdfminer's problem but there's no update about the module...
(I'm running this on my conda env)
Does anyone know what this error means? and how to fix it?
When I encountered this I used:
pip install chardet
there. I faced the same problem when trying to use the pdfplumber package today (2022-11-24) from a script I have long used with no problem. I don't know why this error is happening but found one of the solutions in this link helpful:
How to fix AttributeError: partially initialized module?
Briefly, I removed my entire virtual environment using the command conda env remove --name ds (being ds the name of my environment). Then, I created a new one and installed every package I needed again through conda or pip. It is working perfectly now. Hope it works for you as well.
Out of curiosity, I have installed Tensorflow last week. Maybe it interfered with pdfplumber somehow (not sure). Have you installed any new package since the last time you used pdfminer? Best of luck!
use follow instead.
pip install mmcv-full==1.3.17
I use windows system with pyCharm. I tried to use plot in my code so I add "import plotly" at the beginning, and I install plotly package in the project interpreter (plotly version is the latest, 3.7.0).
When I tried to run my program, it has a ModuleNotFoundError, stating no module named '_plotly_utils'
I'm confused and I don't know what else package should I install or if there's anything else I can do to solve this problem. Thank you!
To be clear, I'll display the total error message below:
Traceback (most recent call last):
File "C:/Users/Bobo/PycharmProjects/Assignment2.1/Main.py", line 12, in <module>
from plotly.offline import iplot, init_notebook_mode
File "C:\Users\Bobo\PycharmProjects\Assignment2.1\venv\lib\site-packages\plotly\__init__.py", line 31, in <module>
from plotly import (plotly, dashboard_objs, graph_objs, grid_objs, tools,
File "C:\Users\Bobo\PycharmProjects\Assignment2.1\venv\lib\site-packages\plotly\plotly\__init__.py", line 10, in <module>
from . plotly import (
File "C:\Users\Bobo\PycharmProjects\Assignment2.1\venv\lib\site-packages\plotly\plotly\plotly.py", line 32, in <module>
from _plotly_utils.basevalidators import CompoundValidator, is_array
ModuleNotFoundError: No module named '_plotly_utils'
You have to install it with :
Settings -->Project --> Project Interpreter --> on the plus right site--> search for your module and download it!
and change the file name, don't use "plotly" as file name :)
pip was working with me and all it's modules but after i was testing new methods in my code pychram stopped and lagged, so i restarted my laptop and now pip isn't working nor it's modules , like tweepy
This is what the computer tell me when i write pip in the cmd
File "c:\users\goldenworld\appdata\local\programs\python\python36\lib\runpy.py", line 14, in <mo dule>
import importlib.machinery # importlib first so we can test #15386 via -m
File "c:\users\goldenworld\appdata\local\programs\python\python36\lib\importlib\__init__.py", li ne 57, in <module>
import types
File "c:\users\goldenworld\appdata\local\programs\python\python36\lib\types.py", line 171, in <m odule>
import functools as _functools
File "c:\users\goldenworld\appdata\local\programs\python\python36\lib\functools.py", line 21, in <module>
from collections import namedtuple
File "c:\users\goldenworld\appdata\local\programs\python\python36\lib\collections\__init__.py", line 135
'od.__iter__() <==> iter(od)
^
SyntaxError: EOL while scanning string literal
I was using the method __iter__(),
even tkinter package isn't working.
What you have done there is totally messed the program and specifically python, I have not used pip but considering what you have done try this:
Re-Install the program.
Re-Install python.
Never attempt that again.
Having an issue with a fresh install of Anaconda. I created an environment with Python 3.5 and trying to run a simple script but for whatever reason I am seeing an issue during the import statements.
import os
import csv
import numpy as np
import scipy
So there are other reports of similar errors on SO but they are from awhile back and do not seem to be linked to Anaconda. I have NOT seen this before on my laptop )running el capitan) also running miniconda (btw this is happening on a mac osx el capitan). I cannot understand why anaconda would try calling usr/local/lib/python2.7 while the environment is in python 3.5. Is this normal? Any assistance would be greatly appreciated!!!
Traceback (most recent call last):
File "myTest.py", line 11, in <module>
import scipy
File "/Users/dennis/anaconda/envs/test/lib/python3.5/site-packages/scipy/__init__.py", line 61, in <module>
from numpy import show_config as show_numpy_config
File "/usr/local/lib/python2.7/site-packages/numpy/__init__.py", line 180, in <module>
from . import add_newdocs
File "/usr/local/lib/python2.7/site-packages/numpy/add_newdocs.py", line 13, in <module>
from numpy.lib import add_newdoc
File "/usr/local/lib/python2.7/site-packages/numpy/lib/__init__.py", line 8, in <module>
from .type_check import *
File "/usr/local/lib/python2.7/site-packages/numpy/lib/type_check.py", line 11, in <module>
import numpy.core.numeric as _nx
File "/usr/local/lib/python2.7/site-packages/numpy/core/__init__.py", line 14, in <module>
from . import multiarray
ImportError: dlopen(/usr/local/lib/python2.7/site-packages/numpy/core/multiarray.so, 2): Symbol not found: _PyBuffer_Type
Referenced from: /usr/local/lib/python2.7/site-packages/numpy/core/multiarray.so
Expected in: flat namespace
in /usr/local/lib/python2.7/site-packages/numpy/core/multiarray.so
Well after digging around and trying to solve this issue most of last night I could not come up with much. I must have done something to my environment (I had done some builds of a couple of libraries from source)...anyway worst StackOverflow answer of all time, I used my TimeMachine to reset my mac back a week and the issue is gone. I guess the lesson is even if you are using environments in anaconda backups still cannot be beat.
Getting pretty frustrated with this. I installed pygtk 2.24, pycairo 1.8.10, and pyobject 2.28.3 all for my 32 bit system and my installed Python version of 2.7. I have GTK+ installed and working.
Also, I have the path to "C:\Python27\Lib\site-packages\gtk-2.0" set in sys.path (where pygtk and pobject reside) and my Path system variable for GTK_BASEPATH is set to C:\gtk, where GTK+ resides.
I get this error when I attempt to import gtk:
Traceback (most recent call last):
File "<pyshell#6>", line 1, in <module>
import gtk
File "C:\Python27\lib\site-packages\gtk-2.0\gtk\__init__.py", line 30, in <module>
import gobject as _gobject
File "C:\Python27\lib\site-packages\gtk-2.0\gobject\__init__.py", line 26, in <module>
from glib import spawn_async, idle_add, timeout_add, timeout_add_seconds, \
File "C:\Python27\lib\site-packages\gtk-2.0\glib\__init__.py", line 22, in <module>
from glib._glib import *
ImportError: DLL load failed: The specified procedure could not be found.
I can't figure out what's wrong. Anyone have any ideas?
EDIT
Found this post, and I found a variable for GtkSharp (don't know where it came from) but removing it did not help.
Try uninstalling all of that (including GTK+, unless something else needs it) and use the PyGTK all-in-one installer instead.
If you're compiling your own, make sure you go in the 'dist' folder and run the created installer to use your version on your machine.
Windows compilation directions:
http://git.gnome.org/browse/pygtk/tree/README.win32