I am trying to run a python script on a linux box with a specific version of python and I'm having some trouble. Every time I try to run the script on the linux box I get the traceback pasted below. The box has an Isilon storage system mounted where the script is stored. When I try to run the script on the head node of the Isilon, it runs fine. I can't figure out what would be different between the two systems, because I am using the same version of python in both places. To make it even more confusing, some of the linux boxes run the script just fine. All the linux boxes seemingly have the same version everything, I installed all the software at the same time from the same disk. Any feedback would be greatly appreciated. I'm happy to provide more explanation if necessary, I'm sure this is confusing.
I replaced the full path the scripts with "PATH".
ERROR:root:code for hash sha512 was not found.
Traceback (most recent call last):
File "PATH/libexec/python/lib/python2.7/hashlib.py", line 139, in <module>
globals()[__func_name] = __get_hash(__func_name)
File "PATH/libexec/python/lib/python2.7/hashlib.py", line 91, in __get_builtin_constructor
raise ValueError('unsupported hash type ' + name)
ValueError: unsupported hash type sha512
Traceback (most recent call last):
File "diskLoader/DiskLoaderMonitoring.py", line 12, in <module>
from WasabiClient import WasabiClient
File "PATH/lib/WasabiClient.py", line 13, in <module>
from ServiceClient import ServiceClient
File "PATH/lib/ServiceClient.py", line 6, in <module>
import requests
File "PATH/libexec/python/lib/python2.7/site-packages/requests-2.0.0-py2.7.egg/requests/__init__.py", line 58, in <module>
from . import utils
File "PATH/libexec/python/lib/python2.7/site-packages/requests-2.0.0-py2.7.egg/requests/utils.py", line 23, in <module>
from .compat import parse_http_list as _parse_list_header
File "PATH/libexec/python/lib/python2.7/site-packages/requests-2.0.0-py2.7.egg/requests/compat.py", line 7, in <module>
from .packages import charade as chardet
File "PATH/libexec/python/lib/python2.7/site-packages/requests-2.0.0-py2.7.egg/requests/packages/__init__.py", line 3, in <module>
from . import urllib3
File "PATH/libexec/python/lib/python2.7/site-packages/requests-2.0.0-py2.7.egg/requests/packages/urllib3/__init__.py", line 16, in <module>
from .connectionpool import (
File "PATH/libexec/python/lib/python2.7/site-packages/requests-2.0.0-py2.7.egg/requests/packages/urllib3/connectionpool.py", line 60, in <module>
from .response import HTTPResponse
File "PATH/libexec/python/lib/python2.7/site-packages/requests-2.0.0-py2.7.egg/requests/packages/urllib3/response.py", line 14, in <module>
from .util import is_fp_closed
File "PATH/libexec/python/lib/python2.7/site-packages/requests-2.0.0-py2.7.egg/requests/packages/urllib3/util.py", line 11, in <module>
from hashlib import md5, sha1
ImportError: cannot import name md5
Related
I'm trying to use cvxpy on a pythonanywhere server, the installation was ok, no errors however when i want to import cvpxy as cp, i have an error, help me please
the error :
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/padacore/.virtualenvs/env/lib/python3.7/site-packages/cvxpy/__init__.py", line 18, in <module>
from cvxpy.atoms import *
File "/home/padacore/.virtualenvs/env/lib/python3.7/site-packages/cvxpy/atoms/__init__.py", line 17, in <module>
from cvxpy.atoms.cummax import cummax
File "/home/padacore/.virtualenvs/env/lib/python3.7/site-packages/cvxpy/atoms/cummax.py", line 17, in <module>
from cvxpy.atoms.atom import Atom
File "/home/padacore/.virtualenvs/env/lib/python3.7/site-packages/cvxpy/atoms/atom.py", line 21, in <module>
from cvxpy.expressions.constants import Constant
File "/home/padacore/.virtualenvs/env/lib/python3.7/site-packages/cvxpy/expressions/constants/__init__.py", line 17, in <module>
from .constant import Constant
File "/home/padacore/.virtualenvs/env/lib/python3.7/site-packages/cvxpy/expressions/constants/constant.py", line 22, in <module>
from scipy.sparse.linalg import eigsh
File "/home/padacore/.virtualenvs/env/lib/python3.7/site-packages/scipy/sparse/linalg/__init__.py", line 111, in <module>
from .isolve import *
File "/home/padacore/.virtualenvs/env/lib/python3.7/site-packages/scipy/sparse/linalg/isolve/__init__.py", line 4, in <module>
from .iterative import *
File "/home/padacore/.virtualenvs/env/lib/python3.7/site-packages/scipy/sparse/linalg/isolve/iterative.py", line 8, in <module>
from . import _iterative
ImportError: /home/padacore/.virtualenvs/env/lib/python3.7/site-packages/scipy/sparse/linalg/isolve/../../../../scipy.libs/libopenblasp-r0-085ca80a.3.9.so: cannot read file data
It could be something to do with Atom, try switching to another editor. I recommend PyCharm or VSCode. If you're choosing VSCode, install these extensions: Python, PyLance, and Jupyter.
If you don't like VSCode's default themes, and miss Atom's One Dark, then there's an extension just for that! Just search for it, and you'll find it!
EDIT: If it wasn't something to do with Atom, maybe install an older version of cvxpy
A few hours ago I updated Xcode to the latest version, which caused gcloud and gsutil commands to stop working. For example, a minute before the update finished, the command gsutil -m rsync was working fine.
While writing this question, I noticed I no longer have git working.
Since I'm not a Python guy, can someone please explain to me what the hell happened now? I would love some help.
python -V output is Python 2.7.16.
python3 -V output is Python 3.9.0.
pip -V output is pip 20.2.3 from /Users/<MY_USER>/Library/Python/2.7/lib/python/site-packages/pip (python 2.7)
pip3 -V output is pip 20.2.3 from /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages/pip (python 3.9)
This is what I get for gcloud help:
Traceback (most recent call last):
File "/Users/<MY_USER>/gcloud/sdk/lib/gcloud.py", line 104, in <module>
main()
File "/Users/<MY_USER>/gcloud/sdk/lib/gcloud.py", line 62, in main
from googlecloudsdk.core.util import encoding
File "/Users/<MY_USER>/gcloud/sdk/lib/googlecloudsdk/__init__.py", line 23, in <module>
from googlecloudsdk.core.util import importing
File "/Users/<MY_USER>/gcloud/sdk/lib/googlecloudsdk/core/util/importing.py", line 23, in <module>
import imp
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/imp.py", line 23, in <module>
from importlib import util
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/util.py", line 2, in <module>
from . import abc
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/abc.py", line 17, in <module>
from typing import Protocol, runtime_checkable
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/typing.py", line 26, in <module>
import re as stdlib_re # Avoid confusion with the re we export.
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/re.py", line 124, in <module>
import enum
File "/Users/<MY_USER>/gcloud/sdk/lib/third_party/enum/__init__.py", line 26, in <module>
spec = importlib.util.find_spec('enum')
AttributeError: module 'importlib' has no attribute 'util'
And this is what I get for gsutil help:
Traceback (most recent call last):
File "/Users/<MY_USER>/gcloud/sdk/bin/bootstrapping/gsutil.py", line 13, in <module>
import bootstrapping
File "/Users/<MY_USER>/gcloud/sdk/bin/bootstrapping/bootstrapping.py", line 32, in <module>
import setup # pylint:disable=g-import-not-at-top
File "/Users/<MY_USER>/gcloud/sdk/bin/bootstrapping/setup.py", line 57, in <module>
from googlecloudsdk.core.util import platforms
File "/Users/<MY_USER>/gcloud/sdk/lib/googlecloudsdk/__init__.py", line 23, in <module>
from googlecloudsdk.core.util import importing
File "/Users/<MY_USER>/gcloud/sdk/lib/googlecloudsdk/core/util/importing.py", line 23, in <module>
import imp
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/imp.py", line 23, in <module>
from importlib import util
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/util.py", line 2, in <module>
from . import abc
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/importlib/abc.py", line 17, in <module>
from typing import Protocol, runtime_checkable
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/typing.py", line 26, in <module>
import re as stdlib_re # Avoid confusion with the re we export.
File "/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/re.py", line 124, in <module>
import enum
File "/Users/<MY_USER>/gcloud/sdk/lib/third_party/enum/__init__.py", line 26, in <module>
spec = importlib.util.find_spec('enum')
AttributeError: module 'importlib' has no attribute 'util'
So after almost a day with nothing, I found a solution: what I needed to do was set an environment variable named CLOUDSDK_PYTHON to /usr/bin/python.
I edited my .zprofile and added:
export CLOUDSDK_PYTHON="/usr/bin/python"
I still have no idea what caused it, so I'll be glad for an explanation if anyone cares to take the time.
The software fails to install. Any help in resolving this would be appreciated.
I believe that the error is probably a dependency error.
Running setup.py (path:/tmp/pip-build-9rlb94_r/hashlib/setup.py) egg_info for package hashlib
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "/usr/local/lib/python3.4/dist-packages/setuptools/__init__.py", line 10, in <module>
from setuptools.extern.six.moves import filter, map
File "/usr/local/lib/python3.4/dist-packages/setuptools/extern/__init__.py", line 1, in <module>
from pkg_resources.extern import VendorImporter
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 36, in <module>
import email.parser
File "/usr/lib/python3.4/email/parser.py", line 12, in <module>
from email.feedparser import FeedParser, BytesFeedParser
File "/usr/lib/python3.4/email/feedparser.py", line 27, in <module>
from email import message
File "/usr/lib/python3.4/email/message.py", line 16, in <module>
from email import utils
File "/usr/lib/python3.4/email/utils.py", line 28, in <module>
import random
File "/usr/lib/python3.4/random.py", line 45, in <module>
from hashlib import sha512 as _sha512
File "/tmp/pip-build-9rlb94_r/hashlib/hashlib.py", line 80
raise ValueError, "unsupported hash type"
^
SyntaxError: invalid syntax
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 3, in <module>
File "/usr/local/lib/python3.4/dist-packages/setuptools/__init__.py", line 10, in <module>
from setuptools.extern.six.moves import filter, map
File "/usr/local/lib/python3.4/dist-packages/setuptools/extern/__init__.py", line 1, in <module>
from pkg_resources.extern import VendorImporter
File "/usr/local/lib/python3.4/dist-packages/pkg_resources/__init__.py", line 36, in <module>
import email.parser
File "/usr/lib/python3.4/email/parser.py", line 12, in <module>
from email.feedparser import FeedParser, BytesFeedParser
File "/usr/lib/python3.4/email/feedparser.py", line 27, in <module>
from email import message
File "/usr/lib/python3.4/email/message.py", line 16, in <module>
from email import utils
File "/usr/lib/python3.4/email/utils.py", line 28, in <module>
import random
File "/usr/lib/python3.4/random.py", line 45, in <module>
from hashlib import sha512 as _sha512
File "/tmp/pip-build-9rlb94_r/hashlib/hashlib.py", line 80
raise ValueError, "unsupported hash type"
^
SyntaxError: invalid syntax
----------------------------------------
I am using this library to generate hashes for files and so alternative solutions would also be welcome.
hashlib module is installed by default (I think Python 2.6+). You are trying to install a backport of it created for forward compatibility of old Python versions.
Just do import hashlib and do your stuff.
You could find info about packages by searching in https://pypi.python.org/pypi.
I've been trying to figure out how to ssh using python 2.7 on a 64-bit Windows 8 computer. I found a module called ssh, so I used pip to install it. But when I type,
>>> import ssh
It gives me this error,
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import ssh
File "C:\Python27\lib\site-packages\ssh\__init__.py", line 62, in <module>
from transport import SecurityOptions, Transport
File "C:\Python27\lib\site-packages\ssh\transport.py", line 33, in <module>
from ssh import util
File "C:\Python27\lib\site-packages\ssh\util.py", line 33, in <module>
from ssh.common import *
File "C:\Python27\lib\site-packages\ssh\common.py", line 98, in <module>
from Crypto import Random
File "c:\users\sethco~1\appdata\local\temp\easy_install-u7gyec\pycrypto-2.6-py2.7-win-amd64.egg.tmp\Crypto\Random\__init__.py", line 28, in <module>
File "c:\users\sethco~1\appdata\local\temp\easy_install-u7gyec\pycrypto-2.6-py2.7-win-amd64.egg.tmp\Crypto\Random\OSRNG\__init__.py", line 34, in <module>
File "c:\users\sethco~1\appdata\local\temp\easy_install-u7gyec\pycrypto-2.6-py2.7-win-amd64.egg.tmp\Crypto\Random\OSRNG\nt.py", line 28, in <module>
File "c:\users\sethco~1\appdata\local\temp\easy_install-u7gyec\pycrypto-2.6-py2.7-win-amd64.egg.tmp\Crypto\Random\OSRNG\winrandom.py", line 7, in <module>
File "c:\users\sethco~1\appdata\local\temp\easy_install-u7gyec\pycrypto-2.6-py2.7-win-amd64.egg.tmp\Crypto\Random\OSRNG\winrandom.py", line 6, in __bootstrap__
ImportError: DLL load failed: %1 is not a valid Win32 application.
I'm not sure what it means. Did I install it correctly? How do I fix this? Are there any alternatives? I would appreciate your help very much.
I'm trying to build a python script which has the line "import paramiko" and I get this error:
Traceback (most recent call last):
File "script.py", line 3, in <module>
import paramiko
File "/home/FBML7HR/.local/lib/python3.4/site-packages/paramiko-1.15.1-py3.4.egg/paramiko/__init__.py", line 30, in <module>
File "/home/FBML7HR/.local/lib/python3.4/site-packages/paramiko-1.15.1-py3.4.egg/paramiko/transport.py", line 49, in <module>
File "/home/FBML7HR/.local/lib/python3.4/site-packages/paramiko-1.15.1-py3.4.egg/paramiko/dsskey.py", line 26, in <module>
File "/home/FBML7HR/.local/lib/python3.4/site-packages/Crypto/PublicKey/DSA.py", line 89, in <module>
from Crypto import Random
File "/home/FBML7HR/.local/lib/python3.4/site-packages/Crypto/Random/__init__.py", line 29, in <module>
from Crypto.Random import _UserFriendlyRNG
File "/home/FBML7HR/.local/lib/python3.4/site-packages/Crypto/Random/_UserFriendlyRNG.py", line 38, in <module>
from Crypto.Random.Fortuna import FortunaAccumulator
File "/home/FBML7HR/.local/lib/python3.4/site-packages/Crypto/Random/Fortuna/FortunaAccumulator.py", line 39, in <module>
from . import FortunaGenerator
File "/home/FBML7HR/.local/lib/python3.4/site-packages/Crypto/Random/Fortuna/FortunaGenerator.py", line 36, in <module>
from Crypto.Cipher import AES
File "/home/FBML7HR/.local/lib/python3.4/site-packages/Crypto/Cipher/AES.py", line 50, in <module>
from Crypto.Cipher import _AES
ImportError: /home/FBML7HR/.local/lib/python3.4/site-packages/Crypto/Cipher/_AES.cpython-34m.so: undefined symbol: rpl_malloc
I've installed pycrypto and paramiko modules. Any idea what could be the problem here?
somebody had a similar issue with pycrypto and fixed by setting an env and doing a re-install. Check out http://github.com/jtriley/StarCluster/issues/138