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
Related
I am getting an error message when I try to run a python script, the python script I am attempting to run is https://raw.githubusercontent.com/orangetw/awesome-jenkins-rce-2019/master/exp.py I don't think that this is an issue with the script as I am able to run this on my host OS (having run the script in as OS)
Traceback (most recent call last):
File "exp.py", line 7, in <module>
import requests
File "/usr/local/lib/python2.7/dist-packages/requests/__init__.py", line 84, in <module>
from urllib3.contrib import pyopenssl
File "/usr/local/lib/python2.7/dist-packages/urllib3/contrib/pyopenssl.py", line 46, in <module>
import OpenSSL.SSL
File "/home/kali/.local/lib/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import crypto, SSL
File "/home/kali/.local/lib/python2.7/site-packages/OpenSSL/crypto.py", line 12, in <module>
from cryptography import x509
File "/usr/local/lib/python2.7/dist-packages/cryptography/x509/__init__.py", line 8, in <module>
from cryptography.x509.base import (
File "/usr/local/lib/python2.7/dist-packages/cryptography/x509/base.py", line 18, in <module>
from cryptography.x509.extensions import Extension, ExtensionType
File "/usr/local/lib/python2.7/dist-packages/cryptography/x509/extensions.py", line 26, in <module>
from cryptography.x509.general_name import GeneralName, IPAddress, OtherName
File "/usr/local/lib/python2.7/dist-packages/cryptography/x509/general_name.py", line 16, in <module>
from cryptography.x509.name import Name
File "/usr/local/lib/python2.7/dist-packages/cryptography/x509/name.py", line 28, in <module>
_ASN1_TYPE_TO_ENUM = {i.value: i for i in _ASN1Type}
TypeError: 'type' object is not iterable
line 7 is
import requests
Help appreciated
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 have Ubuntu 12.04 with Python 2.7 and Python 3 installed. I installed pygame through sudo apt-get python-pygame and also from the source. When I tried >>>import pygame on Python I get this error:
`
>>> import pygame<br>
Jello, world!<br>
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/pygame/__init__.py", line 255, in <module>
try: import pygame.surfarray
File "/usr/lib/python2.7/dist-packages/pygame/surfarray.py", line 69, in <module>
import pygame._numpysurfarray as numpysf
File "/usr/lib/python2.7/dist-packages/pygame/_numpysurfarray.py", line 48, in <module>
import numpy
File "/usr/lib/python2.7/dist-packages/numpy/__init__.py", line 153, in <module>
import polynomial
File "/usr/lib/python2.7/dist-packages/numpy/polynomial/__init__.py", line 18, in <module>
from polynomial import Polynomial
File "/usr/lib/python2.7/dist-packages/numpy/polynomial/polynomial.py", line 60, in <module>
from polytemplate import polytemplate
File "/usr/lib/python2.7/dist-packages/numpy/polynomial/polytemplate.py", line 20, in <module>
polytemplate = string.Template('''
AttributeError: 'module' object has no attribute 'Template'
Error in sys.excepthook:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/apport_python_hook.py", line 66, in apport_excepthook
from apport.fileutils import likely_packaged, get_recent_crashes
File "/usr/lib/python2.7/dist-packages/apport/__init__.py", line 1, in <module>
from apport.report import Report
File "/usr/lib/python2.7/dist-packages/apport/report.py", line 18, in <module>
import problem_report
File "/usr/lib/python2.7/dist-packages/problem_report.py", line 16, in <module>
from email.mime.multipart import MIMEMultipart
File "/usr/lib/python2.7/email/mime/multipart.py", line 9, in <module>
from email.mime.base import MIMEBase
File "/usr/lib/python2.7/email/mime/base.py", line 9, in <module>
from email import message
File "/usr/lib/python2.7/email/message.py", line 16, in <module>
import email.charset
File "/usr/lib/python2.7/email/charset.py", line 14, in <module>
import email.quoprimime
File "/usr/lib/python2.7/email/quoprimime.py", line 48, in <module>
from string import hexdigits
ImportError: cannot import name hexdigits
Original exception was:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.7/dist-packages/pygame/__init__.py", line 255, in <module>
try: import pygame.surfarray
File "/usr/lib/python2.7/dist-packages/pygame/surfarray.py", line 69, in <module>
import pygame._numpysurfarray as numpysf
File "/usr/lib/python2.7/dist-packages/pygame/_numpysurfarray.py", line 48, in <module>
import numpy
File "/usr/lib/python2.7/dist-packages/numpy/__init__.py", line 153, in <module>
import polynomial
File "/usr/lib/python2.7/dist-packages/numpy/polynomial/__init__.py", line 18, in <module>
from polynomial import Polynomial
File "/usr/lib/python2.7/dist-packages/numpy/polynomial/polynomial.py", line 60, in <module>
from polytemplate import polytemplate
File "/usr/lib/python2.7/dist-packages/numpy/polynomial/polytemplate.py", line 20, in <module>
polytemplate = string.Template('''
AttributeError: 'module' object has no attribute 'Template'
I saw the Jello World so I guess it is working a bit. I dont know what to do. I appreciate the help. Thanks in advance.
That looks like you don't have SDL installed on your box.
Remove your current pygame packages then dot he following:
wget http://www.libsdl.org/release/SDL-1.2.14.tar.gz
tar -xzvf SDL-1.2.14.tar.gz
cd SDL-1.2.14
./configure
make
make install
Once this has completed reinstall pygame but try reinstalling via easy_install or pip:
easy_install pygame
or
pip install pygame
You should be good to go after that.
I am trying to use elastic beanstalk cli on an amazon linux instance and I always get zlib module error. This probably is more to do with my linux/unix ignorance but please send any inputs you have.
$ eb init
Traceback (most recent call last):
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/eb", line 17, in <module>
from scli import core
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/scli/core .py", line 24, in <module>
from scli import command, cli_parse, config_file, prompt
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/scli/comm and.py", line 18, in <module>
from scli.operation_queue import OperationQueue
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/scli/oper ation_queue.py", line 19, in <module>
from scli.operation.base import OperationBase
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/scli/oper ation/base.py", line 21, in <module>
from lib.elasticbeanstalk import eb_utils
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/lib/elast icbeanstalk/eb_utils.py", line 22, in <module>
from scli import api_wrapper
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/scli/api_ wrapper.py", line 19, in <module>
from lib.elasticbeanstalk.servicecall import ElasticBeanstalkClient
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/lib/elast icbeanstalk/servicecall.py", line 23, in <module>
from lib.aws.webservice import AWSQueryClient, AWSSignature
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/lib/aws/w ebservice.py", line 26, in <module>
from . import requests
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/lib/aws/r equests/__init__.py", line 52, in <module>
from . import utils
File "/home/ec2-user/AWS-ElasticBeanstalk-CLI-2.4.0/eb/linux/python3/lib/aws/r equests/utils.py", line 18, in <module>
import zlib
ImportError: No module named zlib