Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/local/lib/python2.7/dist-packages/zmq/__init__.py", line 51, in <module>
from zmq import core, devices
File "/usr/local/lib/python2.7/dist-packages/zmq/core/__init__.py", line 26, in <module>
from zmq.core import (constants, error, message, context,
ImportError: /usr/local/lib/python2.7/dist-packages/zmq/core/socket.so: undefined symbol:
zmq_sendmsg
I am getting above error. I have followed steps given on the official site of ZeroMQ.
Had a similar issue when building for Java, UnsatisifedLinkError, after the so libraries were copied to /usr/local/lib, seems like your issue might be the same...I fixed it by logging off then logging back in again, I read something about the libraries not being visible until the user logs back in, weird, but it worked for me.
Related
Good afternoon, For the second day I can't move forward because of this problem. I've been doing python recently. I downloaded all packages, checked with the versions I have python 3.10. And it gives this error every time. Tell me what to do, please.
D:\pythonProject\venv\Scripts\python.exe D:\pythonProject\main.py
Traceback (most recent call last):
File "D:\pythonProject\main.py", line 1, in <module>
from imageai.Detection import ObjectDetection
File "D:\pythonProject\venv\lib\site-packages\imageai\Detection\__init__.py", line 2, in <module>
from imageai.Detection.keras_retinanet.models.resnet import resnet50_retinanet
File "D:\pythonProject\venv\lib\site-packages\imageai\Detection\keras_retinanet\models\resnet.py", line 19, in <module>
import keras
ModuleNotFoundError: No module named 'keras'
Process finished with exit code 1
Deleted, changed the interpreter (PyCharm to VS), changed the file paths.
I tried to load gensim in my code. Often it works fine. Today, I get the following exception:
Traceback (most recent call last):
File "/project/6008168/tamouze/just.py", line 2, in <module>
import gensim
File "/project/6008168/tamouze/Python_directory/ENV2.7_new/lib/python2.7/site-packages/gensim/__init__.py", line 5, in <module>
from gensim import parsing, corpora, matutils, interfaces, models, similarities, summarization, utils # noqa:F401
File "/project/6008168/tamouze/Python_directory/ENV2.7_new/lib/python2.7/site-packages/gensim/parsing/__init__.py", line 4, in <module>
from .preprocessing import (remove_stopwords, strip_punctuation, strip_punctuation2, # noqa:F401
File "/project/6008168/tamouze/Python_directory/ENV2.7_new/lib/python2.7/site-packages/gensim/parsing/preprocessing.py", line 40, in <module>
from gensim import utils
File "/project/6008168/tamouze/Python_directory/ENV2.7_new/lib/python2.7/site-packages/gensim/utils.py", line 44, in <module>
from smart_open import smart_open
File "/project/6008168/tamouze/Python_directory/ENV2.7_new/lib/python2.7/site-packages/smart_open/__init__.py", line 1, in <module>
from .smart_open_lib import *
File "/project/6008168/tamouze/Python_directory/ENV2.7_new/lib/python2.7/site-packages/smart_open/smart_open_lib.py", line 29, in <module>
import requests
File "/project/6008168/tamouze/Python_directory/ENV2.7_new/lib/python2.7/site-packages/requests/__init__.py", line 97, in <module>
from . import utils
File "/project/6008168/tamouze/Python_directory/ENV2.7_new/lib/python2.7/site-packages/requests/utils.py", line 26, in <module>
from ._internal_utils import to_native_string
ImportError: cannot import name to_native_string
Im using python 2.7.14 and gensim 3.4.0.
How can I solve this problem?
The error isn't really occurring in gensim, even though that's how you found it. If you look at the stack, it's only triggered because gensim uses smart_open which in turn uses requests. It is in requests that the error happens.
If this was working, but now stopped, something likely changed in your environment, or how you're launching this code, related to the relationship between Python and the requests package.
For such errors, you should try searching Google for the final-two lines of your error stack – those most connected to the problem. Those are:
from ._internal_utils import to_native_string
ImportError: cannot import name to_native_string
(These leave out the file path that's specific to you, but have a number of unique tokens likely to have also been reported by any others.)
A number of people have hit this, from a variety of other projects, but always triggered through requests. Some have reported re-installing requests (perhaps to ensure it's version 2.0.0 or later) helps.
If a simple re-install doesn't help, you could also try one or all of:
uninstall, verify it's not present at all (that requests itself isn't found), then install – this could make sure you don't have overlapping redundant installations in different places that are both confusing the issue
start from a fresh Python environment, reinstalling all packages
double-check that all packages share the same Python2/Python3 compatibility
I'm trying to run this Google Endpoints python tutorial.
Traceback (most recent call last):
File "main.py", line 19, in <module>
import endpoints
File "/home/mica/.local/lib/python2.7/site-packages/endpoints/__init__.py", line 27, in <module>
from .apiserving import *
File "/home/mica/.local/lib/python2.7/site-packages/endpoints/apiserving.py", line 81, in <module>
from protorpc.wsgi import service as wsgi_service
ImportError: No module named wsgi
The error clearly comes from a python library. How am I supposed to fix the issue?
That "tutorial" doesn't correspond to any tutorial from the Google Endpoints team. The official tutorial uses this instead.
I just came up against the same problem in the 'hello world' tutorial for ProtoRPC.
As indicated by your error traceback, an ImportError occurs when Endpoints tries to import the protorpc.wsgi module, which is missing.
It turns out that the protorpc.wsgi module has been missing for some time. There's a pull request from 2016 that should have fixed the omission, but for some reason it was never merged. I've left a comment there, which is probably just about all we can do.
i am running python 3.2.6 on an a2hosting shared server. when i do
import cgi
i get:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib64/python3.2/cgi.py", line 38, in <module>
from email.parser import FeedParser
File "/usr/lib64/python3.2/email/parser.py", line 12, in <module>
from email.feedparser import FeedParser, BytesFeedParser
File "/usr/lib64/python3.2/email/feedparser.py", line 27, in <module>
from email import message
File "/usr/lib64/python3.2/email/message.py", line 19, in <module>
from email import header
File "/usr/lib64/python3.2/email/header.py", line 17, in <module>
import email.base64mime
EOFError: EOF read where not expected
how can i solve this? i do not have root access.
edit:
this is the answer i got from a2hosting support:
Hello, Unfortunately, we really cannot provide development assistance here. This is quite above and beyond our scope of support. While we'd like to be able to provide support for each and every program, language, script, etc, that comes out, it's just physically impossible to do so. You'll want to work with your development team, or the applications developers to ensure that this is something that's investigated thoroughly.
i circumvented the issue by installing a different version of python, following this: https://www.a2hosting.com/kb/developer-corner/python/using-a-newer-version-of-python
I have successfully installed cherrypy but when I try to import it, I get following error. I am a newbie and have spent quite a bit of time trying to get this to work, so any help would be highly appreciated.
Traceback (most recent call last):
File "unitconverter.py", line 1, in <module>
import cherrypy
File "c:\Python34\lib\site-packages\cherrypy-3.2.0-py3.4.egg\cherrypy\__init__
.py", line 82, in <module>
from cherrypy import process
File "c:\Python34\lib\site-packages\cherrypy-3.2.0-py3.4.egg\cherrypy\process\
__init__.py", line 14, in <module>
from cherrypy.process import plugins, servers
File "c:\Python34\lib\site-packages\cherrypy-3.2.0-py3.4.egg\cherrypy\process\
plugins.py", line 424, in <module>
class PerpetualTimer(threading._Timer):
AttributeError: 'module' object has no attribute '_Timer'
From what I can see, it's a bug with that version of CherryPy. You'd be best upgrading to a more recent version instead.