>>> import theano
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/theano/__init__.py", line 52, in <module>
from theano.gof import (
File "/Library/Python/2.7/site-packages/theano/gof/__init__.py", line 38, in <module>
from theano.gof.cc import \
File "/Library/Python/2.7/site-packages/theano/gof/cc.py", line 30, in <module>
from theano.gof import link
File "/Library/Python/2.7/site-packages/theano/gof/link.py", line 18, in <module>
from theano.gof.type import Type
File "/Library/Python/2.7/site-packages/theano/gof/type.py", line 17, in <module>
from theano.gof.op import CLinkerObject
File "/Library/Python/2.7/site-packages/theano/gof/op.py", line 25, in <module>
from theano.gof.cmodule import GCC_compiler
File "/Library/Python/2.7/site-packages/theano/gof/cmodule.py", line 8, in <module>
import six.moves.cPickle as pickle
ImportError: No module named cPickle
I'm pretty sure there is no problem with cPickle. Can it be the problem of other dependencies? It's true that I upgraded all the packages this morning, so that a conflict of version may occur. Nonetheless, the problem still exists after I switched to the bleeding-edge version of theano. Would someone help me figure it out?
PS: My developing device is Macbook Pro 13(early 2015); my system version is OS X 10.10.5; python version is 2.7.10
=========================== Second Edit ===================================
It seems I do have latest version of six installed on my Mac.
YiqundeMacBook-Pro:~ Leo$ pip show six
---
Metadata-Version: 2.0
Name: six
Version: 1.9.0
Summary: Python 2 and 3 compatibility utilities
Home-page: http://pypi.python.org/pypi/six/
Author: Benjamin Peterson
Author-email: benjamin#python.org
License: MIT
Location: /Library/Python/2.7/site-packages
Requires:
I had the same problem and upgrading six solved issue:
sudo easy_install --upgrade six
Try to avoid using sudo at all costs. Open a python session and run
import six
print six.__version__
print six.__file__
The version will likely not be most recent (1.10.0), so go manually delete the six.py and six.pyc files at the imported path, and then run pip install six. Python should now be importing the latest version of six, compatible with Theano :)
Related
I am trying to install airnotifier on my machine, I am getting this error
My python version is 3.6
PS C:\airnotifier> python app.py
Traceback (most recent call last):
File "app.py", line 32, in <module>
from pushservices.bootstrap import init_messaging_agents
File "C:\airnotifier\pushservices\bootstrap.py", line 4, in <module>
from .fcm import FCMClient
File "C:\airnotifier\pushservices\fcm.py", line 5, in <module>
from oauth2client.service_account import ServiceAccountCredentials
File "C:\Users\smacrsadmin\AppData\Local\Programs\Python\Python36\lib\site-packages\oauth2client\service_account.py", line 25, in <module>
from oauth2client import client
File "C:\Users\smacrsadmin\AppData\Local\Programs\Python\Python36\lib\site-packages\oauth2client\client.py", line 39, in <module>
from oauth2client import transport
File "C:\Users\smacrsadmin\AppData\Local\Programs\Python\Python36\lib\site-packages\oauth2client\transport.py", line 17, in <module>
import httplib2
File "C:\Users\smacrsadmin\AppData\Local\Programs\Python\Python36\lib\site-packages\httplib2\__init__.py", line 52, in <module>
from . import auth
File "C:\Users\smacrsadmin\AppData\Local\Programs\Python\Python36\lib\site-packages\httplib2\auth.py", line 4, in <module>
import pyparsing as pp
File "C:\Users\smacrsadmin\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__'
I received the same error and I'm also in Python 3.6.0 ...
AttributeError: 'version_info' object has no attribute '__version__'
If you want to dig a little more, you can type this in your console and detect which package is using this dependency.
> pip show pyparsing
In my case the output was something like this, indicating that packaging:
Name: pyparsing
Version: 2.4.7
Summary: Python parsing module
License: MIT License
Location:
Requires:
Required-by: packaging
To fix it, you can go with the suggestion from PaulMcG
pip install pyparsing==2.4.7
Update 2022-Jun-03:
Reference to the issue
https://github.com/pyparsing/pyparsing/releases/tag/pyparsing_3.0.8
Note says:
API CHANGE: modified pyproject.toml to require Python version 3.6.8 or
later for pyparsing 3.x. Earlier minor versions of 3.6 fail in
evaluating the version_info class (implemented using
typing.NamedTuple). If you are using an earlier version of Python 3.6,
you will need to use pyparsing 2.4.7.
I am trying to run InstaPy bot on my Raspberry Pi with 32bit Kali Linux installed. Everything is up to date, upgraded and libc6 updated as well. My GLIBC version is 2.32-4 and according to kali repo this is the most actual version.
$ ldd --version 1 тип
ldd (Debian GLIBC 2.32-4) 2.32
$ apt-cache policy libc6
libc6:
Installed: 2.32-4
Candidate: 2.32-4
Version table:
*** 2.32-4 500
500 http://http.kali.org/kali kali-rolling/main armhf Packages
100 /var/lib/dpkg/status
However if I run bot i get this:
$ python3 quickstart.py
Traceback (most recent call last):
File "/home/kali/Downloads/instapy-quickstart-master/quickstart.py", line 2, in <module>
from instapy import InstaPy
File "/home/kali/.local/lib/python3.10/site-packages/instapy/__init__.py", line 6, in <module>
from .instapy import InstaPy
File "/home/kali/.local/lib/python3.10/site-packages/instapy/instapy.py", line 33, in <module>
from .clarifai_util import check_image
File "/home/kali/.local/lib/python3.10/site-packages/instapy/clarifai_util.py", line 3, in <module>
from clarifai.rest import ClarifaiApp
File "/home/kali/.local/lib/python3.10/site-packages/clarifai/rest/__init__.py", line 3, in <module>
from clarifai.rest.client import ApiClient
File "/home/kali/.local/lib/python3.10/site-packages/clarifai/rest/client.py", line 36, in <module>
from clarifai.rest.grpc.proto.clarifai.api.endpoint_pb2_grpc import V2Stub
File "/home/kali/.local/lib/python3.10/site-packages/clarifai/rest/grpc/proto/clarifai/api/endpoint_pb2_grpc.py", line 2, in <module>
import grpc
File "/home/kali/.local/lib/python3.10/site-packages/grpc/__init__.py", line 22, in <module>
from grpc import _compression
File "/home/kali/.local/lib/python3.10/site-packages/grpc/_compression.py", line 15, in <module>
from grpc._cython import cygrpc
ImportError: /lib/arm-linux-gnueabihf/libc.so.6: version `GLIBC_2.33' not found (required by /home/kali/.local/lib/python3.10/site-packages/grpc/_cython/cygrpc.cpython-310-arm-linux-gnueabihf.so)
I would like to keep Kali I am pretty much used to it. I'd like to point out that I'm not a coder or something just a guy who got his first linux based OS a week ago.
The problem seemed to be incompatible OS. I installed Raspbian and everything went ok.
I am trying to run a program (obviously written in python) and it requires some python modules. One of the missed modules is aiomultiprocess. I tried installing it with pip install aiomultiprocess pip3 install aiomultiprocess python3.7 -m pip install aiomultiprocess but they all come back with the same error message:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/usr/local/lib/python3.7/site-packages/setuptools/__init__.py", line 19, in <module>
from setuptools.dist import Distribution
File "/usr/local/lib/python3.7/site-packages/setuptools/dist.py", line 34, in <module>
from setuptools import windows_support
File "/usr/local/lib/python3.7/site-packages/setuptools/windows_support.py", line 2, in <module>
import ctypes
File "/usr/local/lib/python3.7/ctypes/__init__.py", line 10, in <module>
from _ctypes import Union, Structure, Array
File "/usr/local/lib/python3.7/_ctypes.py", line 5, in <module>
import ffi
ModuleNotFoundError: No module named 'ffi'
No ffi module?! Let's get it!
I looked it up and figured it's a foreign library that come, in the case of python, as 2 forms: CFFI & LibFFI, but "ffi" doesn't exist for python. I installed cffi libffi and added them to this path /usr/local/lib/python3.7/site-packages/, but it changed nothing.
So my question is there another way to install python modules without the need of pip??!
I recently updated my Ubuntu to 18.04 and now when using Python (2.7) I cannot import matplotlib anymore. Error when importing:
>>> import matplotlib
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "~/.local/lib/python2.7/site-packages/matplotlib/__init__.py", line 131, in <module>
from matplotlib.rcsetup import defaultParams, validate_backend, cycler
File "~/.local/lib/python2.7/site-packages/matplotlib/rcsetup.py", line 29, in <module>
from matplotlib.fontconfig_pattern import parse_fontconfig_pattern
File "~/.local/lib/python2.7/site-packages/matplotlib/fontconfig_pattern.py", line 28, in <module>
from backports.functools_lru_cache import lru_cache
ImportError: No module named functools_lru_cache
I installed matplotlib via
pip install --user matplotlib
Like matplotlib, functools_lru_cache-module is installed in
~/.local/lib/python2.7/site-packages
What am I missing here?
I tried uninstalling and reinstalling the "functools_lru_cache" module as suggested here:
python 2.7 functools_lru_cache does not import although installed
but that didn't help. Still same error.
Uninstalling matplotlib via pip and installing an older version (2.0.2) fixed this for me. See: https://stackoverflow.com/a/49335954/1627966
trying to run a pymodbus tcp server and im getting this stack trace... at a total loss here so any help is appreciated. Thanks!
Traceback (most recent call last):
File "Worrking_ModbusJ1939Bridge.py", line 12, in <module>
from pymodbus.server.async import StartTcpServer
File "build/bdist.linux-armv7l/egg/pymodbus/server/async.py", line 18, in <module>
File "build/bdist.linux-armv7l/egg/pymodbus/internal/ptwisted.py", line 5, in <module>
File "/usr/local/lib/python2.7/dist-packages/twisted/conch/manhole_ssh.py", line 14, in <module>
from twisted.conch.ssh import factory, session
File "/usr/local/lib/python2.7/dist-packages/twisted/conch/ssh/factory.py", line 18, in <module>
from twisted.conch.ssh import (_kex, transport, userauth, connection)
File "/usr/local/lib/python2.7/dist packages/twisted/conch/ssh/transport.py", line 345, in <module>
class SSHTransportBase(protocol.Protocol):
File "/usr/local/lib/python2.7/dist-packages/twisted/conch/ssh/transport.py", line 469, in SSHTransportBase
supportedCiphers = _getSupportedCiphers()
File "/usr/local/lib/python2.7/dist-packages/twisted/conch/ssh/transport.py", line 335, in _getSupportedCiphers
backend=default_backend(),
File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/backends/__init__.py", line 15, in default_backend
from cryptography.hazmat.backends.openssl.backend import backend
File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/backends/openssl/__init__.py", line 7, in <module>
from cryptography.hazmat.backends.openssl.backend import backend
File "/usr/local/lib/python2.7/dist-packages/cryptography/hazmat/backends/openssl/backend.py", line 16, in <module>
from cryptography import utils, x509
File "/usr/local/lib/python2.7/dist-packages/cryptography/x509/__init__.py", line 7, in <module>
from cryptography.x509 import certificate_transparency
ImportError: cannot import name certificate_transparency
I was using pip 7 and got the same problem. Upgrading to pip 9 solved it. I'm not sure about the cause.
Via: https://github.com/micheloosterhof/cowrie/issues/618
I've been hitting this while attempting to update Python Cryptography for Solaris 11.4, using the https://github.com/oracle/solaris-userland/ build system. A "simple" update to pip isn't an option for me, that's not how we do things.
I eventually figured out the solution: I'd built the package incorrectly.
Cryptography 2.1.4 depends on cffi > 1.7. Both of these packages have new deliverable bits compared to the versions we were shipping.
Failing to update the package manifest to correctly track the new files results in both cffi and cryptography being unable to import symbols that the current versions depend upon.
[A very big thankyou to Alex Gaynor in #cryptography-dev who set me on the right path to figuring this out].
$ python2.7
Python 2.7.14 (default, Jan 31 2018, 05:35:05) [C] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>> from cryptography.hazmat.bindings._openssl import ffi, lib
>>> from cryptography.x509 import certificate_transparency
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/vendor-packages/cryptography/x509/__init__.py", line 7, in <module>
from cryptography.x509 import certificate_transparency
ImportError: cannot import name certificate_transparency
If you build cryptography and look at what it delivers, you will find that there is in fact a file (shipped on Solaris as /usr/lib/python-$(PYVER)/vendor-packages/cryptography/x509/certificate_transparency.py) - and if that file isn't in the rest of the hierarchy then you end up with exactly this ImportError.
it works for me (problems with paramiko):
https://pypi.python.org/pypi/ctutlz/0.7.0
pip install --process-dependency-links ctutlz
I had a similar issue on RHEL 6.7 x86_64 running Python 2.7.8 with an old version of pip (1.4.1)
It was because I had been installing the "cp27m" builds rather than "cp27mu" builds.
With the old pip 1.4.1 build, it did not complain installing the cp27m builds.
Whereas when upgrading pip to 9.0.3, it spat out the true error ...
(bmcs2)bash-4.1$ pip install cffi-1.11.5-cp27-cp27m-manylinux1_x86_64.whl
cffi-1.11.5-cp27-cp27m-manylinux1_x86_64.whl is not a supported wheel on this platform.
(bmcs2)bash-4.1$ pip install cryptography-2.1.3-cp27-cp27m-manylinux1_x86_64.whl
cryptography-2.1.3-cp27-cp27m-manylinux1_x86_64.whl is not a supported wheel on this platform.
The "ImportError: cannot import name certificate_transparency" was resolved using the "cp27mu" builds. When using the "cp27mu" build, both the pip 1.4.1 and pip 9.0.3 versions worked fine.
cffi-1.11.5-cp27-cp27m-manylinux1_x86_64.whl versus cffi-1.11.5-cp27-cp27mu-manylinux1_x86_64.whl
cryptography-2.1.3-cp27-cp27m-manylinux1_x86_64.whl versus cryptography-2.1.3-cp27-cp27mu-manylinux1_i686.whl
More info here:
https://www.python.org/dev/peps/pep-0513/#ucs-2-vs-ucs-4-builds
I think this more like a paramiko issue not pip. Upgrading pip didn't solve this in my environment i had to downgrade my paramiko version to a version that does not have a libffi dependency, this worked for me:
pip2.7 install paramiko==1.17.0
this issue is related to: https://github.com/paramiko/paramiko/issues/1401
I got this error while trying to run Scrapy in AWS Lambda, deploying with a zip file.
I followed the instructions in https://www.perrygeo.com/running-python-with-compiled-code-on-aws-lambda.html, which basically instructs you to start an Amazon Linux EC2 instance, install the requirements and build the zip from it.
After setting up the whole thing, the first package I created still gave me the same error, but I realised that was because a hidden folder, .libs_cffi_backend, was missing from the zip file. That folder contains a .so file that if not present causes ImportError. After forcefully including it, it worked.