Currently I am using Python 3.7, and Ubuntu 18.04. I downloaded wxPython from pip, but when I tried to import wx in my terminal, I get this error:
>>> import wx
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/aleejandrof/anaconda3/lib/python3.7/site-packages/wx/__init__.py", line 17, in <module>
later on, when I tried other ways like and "._core import" I received an error like this:
ImportError: /home/aleejandrof/anaconda3/bin/../lib/libpangoft2-1.0.so.0: undefined symbol: pango_font_description_set_variations
After reading some posts here, I tried deleting the wx.py and wx.pyc files, which didn't work. The same happened when I read that downloading the main excecutable file would make the import occur with no errors, but it popped the same errors.
AttributeError: module 'wx' has no attribute '__version__'
I am trying to run a GUI pipeline, which works with wxPython. I'm thankful in advance, if any of you has suggestions.
When I made an environment of ubuntu18.04 using docker, ran into the same problem.
I had multiple libpangoft2-1.0.so.0 files.
It seemed the problem was /opt/conda/lib/libpangoft2-1.0.so.0 was looked up.
To change the name of the file solved the problem.
find / -name libpangoft2-1.0.so.0
/opt/conda/lib/libpangoft2-1.0.so.0
/opt/conda/pkgs/pango-1.42.4-h049681c_0/lib/libpangoft2-1.0.so.0
/usr/lib/x86_64-linux-gnu/libpangoft2-1.0.so.0
mv /opt/conda/lib/libpangoft2-1.0.so.0 /opt/conda/lib/libpangoft2-1.0.so.0-void
You may want to try:
conda install -c asmeurer pango
Related
I am working on a script which calls easygui. This has been added to the virtual environment.
The lines involving easygui are
#import module
from easygui import *
#set message and title
msg="Hello World!"
title="Sample Program"
# a simple window showing a message, a title and a ‘Ok’ button
msgbox(msg,title)
The script throws the error below. However, it runs perfectly when I call it from the command line. Why is pycharm throwing an error, but not the command line? Thanks.
Traceback (most recent call last):
File "/Users/nickriches/PycharmProjects/pythonProject3/main.py", line 12, in <module>
from easygui import *
File "/Users/nickriches/PycharmProjects/pythonProject3/venv/lib/python3.7/site-packages/easygui/__init__.py", line 34, in <module>
from .boxes.button_box import buttonbox
File "/Users/nickriches/PycharmProjects/pythonProject3/venv/lib/python3.7/site-packages/easygui/boxes/button_box.py", line 18, in <module>
import global_state
ModuleNotFoundError: No module named 'global_state'
I had this error this afternoon (MacOS M1, running python 3.9), and this is how I fixed it.
Basically the error is caused by the absence of a properly functioning tkinter installation, even though the error is complaining about "global_state". You can work this out by tracing through the code, which I will not do here.
You can prove to yourself that there is a defect in your tkinter installation by opening python in REPL mode and typing:
"import tkinter".
If you get an error, then you are on the right track to continue below.
The solution therefore is to properly get tkinter working.
I installed tkinter on my Mac by going to https://www.activestate.com/products/tcl/downloads/ and installing it.
Then I installed the "python-tk" module by running:
"brew install python-tk".
After that, when I opened python in REPL and ran "import tkinter", things worked.
I am attempting to install ckan on my system and I'm following the install from package directions (http://docs.ckan.org/en/latest/maintaining/installing/install-from-package.html). All the dependencies were installed correctly and the ckan package itself downloaded without error. When I went to run the install I got a module missing error for what to me looks like a trivial python module that should be there.
jeremy#jeremy-HP-ProBook-4530s:~$ sudo dpkg -i python-ckan_2.5-trusty_amd64.deb
[sudo] password for jeremy:
(Reading database ... 214293 files and directories currently installed.)
Preparing to unpack python-ckan_2.5-trusty_amd64.deb ...
Unpacking python-ckan (2.5.1-trusty1) over (2.5.1-trusty1) ...
Setting up python-ckan (2.5.1-trusty1) ...
Traceback (most recent call last):
File "/usr/lib/ckan/default/bin/paster", line 7, in <module>
from paste.script.command import run
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/paste/script/command.py", line 3, in <module>
import pkg_resources
File "/usr/lib/ckan/default/local/lib/python2.7/site-packages/pkg_resources/__init__.py", line 36, in <module>
import plistlib
File "/usr/lib/python2.7/plistlib.py", line 62, in <module>
import datetime
ImportError: No module named datetime
/var/lib/dpkg/info/python-ckan.postinst: line 18: initctl: command not found
Site datapusher already enabled
I've confirmed that datetime is installed with a quick python -c 'import datetime' run. At this point I have done a little bit of digging and haven't been able to find anywhere else where this is duplicated nor exactly how to resolve this. Any help or advice is greatly appreciated.
Looking around for the error from plistlib it looks like the same error affecting https://bugs.launchpad.net/ubuntu/+source/python2.7/+bug/1368144
Unfortunately I'm not sure how this would have come about. I'll continue digging and see if I can find out more, but it isn't anything I've seen before but it definitely appears virtualenv related.
In a round about way, I corrupted my scipy/numpy installation on my IntelX64/Windows 7/Python 2.7 computer. I did this by trying to play around with some neural network libraries (lasagne/theano).
To fix this, I completely removed/reinstalled python 2.7.9. After that, I went to http://www.lfd.uci.edu/~gohlke/pythonlibs/ to download and install numpy and scipy with commands:
pip install C:\Users\me\Documents\numpy-1.9.2+mkl-cp27-none-win_amd64.whl
This went well and succeeded. (I can import numpy from python)
pip install C:\Users\me\Documents\scipy-0.15.1-cp27-none-win_amd64.whl
This appeared to go well too. Except the error occurs in the python console:
>>> from scipy import stats
Gives:
Traceback (most recent call last):
File "<stdin>", line1, in <module>
File "C:\Python27\lib\site-packages\scipy\stats\__init__.py", line 338, in <module>
from .stats import *
File "C:\Python27\lib\site-packages\scipy\stats\stats.py", line 184, in <module>
import scipy.special as special
File "C:\Python27\lib\site-packages\scipy\special\__init__.py", line 586, in <module>
from ._ufuncs import *
ImportError: DLL load failed: The specified module could not be found.
I read up on the DLLs required and ran the 'dependency walker' (http://www.dependencywalker.com/) on "c:\python27\lib\site-packages\scipy\special_UFUNCS.PYD" and it seems there are a few DLL files not found.
libifcoremd.dll
libiomp5md.dll
libmmd.dll
msvcr90.dll
dcomp.dll
ieshims.dll
and a 6 files that look like 'api-ms-win-....dll'
From my looking around, people have solved this by reinstalling numpy, then scipy. I have tried that and the same thing occurs.
Has anyone else run into this issue and solved it?
I fixed this by a complete removal of everything (python and packages) and then installing everything again.
Just reinstalling the offending packages did not work. Neither did system restore. I will not accept this answer, because removing/installing is a work around to the real problem. I just want to post this to help anyone else in this position.
Simply install 'NumPy-1.9+MKL' from this page, it should work fine.
Acknowledgement: Another post here :)
I downloaded this library: https://github.com/bufferapp/buffer-python
Ran the setup.py install, and then tried to run some code using the newly installed library.
What happens though is I get this error:
Traceback (most recent call last):
File "twitter-quote-bot.py", line 14, in <module>
from buffpy.managers.profiles import Profiles
ImportError: No module named managers.profiles
The only way I've found to fix it is to move my program (twitter-quote-bot) into the downloaded folder from Buffer and run it there.
Did I do something wrong in the installation? It seems like I should be able to do these imports globally.
Thanks in advance!
I installed this library called Polygon, in Python 2.7.3. But, each time I import it I get the next error message :
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "Polygon/__init__.py", line 5, in <module>
from Polygon.cPolygon import *
ImportError: No module named cPolygon
I have no idea about what could be going wrong. And also, I have already tried to contact the original author of this on his personal webpage.
but he hasn't replied though :( I wonder if someone can help me with this issue please.
It sounds like you didn't in fact install it, but instead just copied it to your working directory. As always, run setup.py with the appropriate arguments to install.
This error can happen if you try to run python from inside the directory you used to install Polygon. Move to a different directory and try again.