ModuleNotFoundError: No module named 'OpenSSL' despite having pyopenssl installed - python

I am trying to install OpenSSL for Python on windows using command line.
I have tried running the below command:
pip install OpenSSL
I got the following error:
Could not find a version that satisfies the requirement openssl (from versions: )
No matching distribution found for openssl
I also tried doing it as below:
pip install pyopenssl
This succeeded but, when I try running my python script which has the below line, it shows an error:
from OpenSSL import crypto, SSL
Error:
Traceback (most recent call last):
File "C:\Users\ajayv\AppData\Local\Programs\Python\Python36-32\Scripts\ENV\Scripts\PDB Latest 1250\Endpoints\X.509.py", line 1, in <module>
import OpenSSL
ModuleNotFoundError: No module named 'OpenSSL'
Am I missing something? Please let me know.

Related

couldnt install python-colorama

I am trying to install Jarvis ai from https://github.com/sukeesh/Jarvis (I know it is not meant to be installed on windows 10. but I try it anyway)
It said no module named colorama, so I typed pip install python-colorama. Then it said
Could not find a version that satisfies the requirement python-colorama (from versions: )
No matching disribution found for python-colorama
I tried to install it using ubuntu, but different problem occurs: it said
Specify python version(2/3)(Default-3)3
Selected python version 3
Running virtualenv with interpreter /usr/bin/python3
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 22, in <module>
import distutils.spawn
ModuleNotFoundError: No module named 'distutils.spawn'
So its like asking 2 question in one. On windows it is
C:\Users\badarsyah\Jarvis>pip install python-colorama
Collecting python-colorama
Could not find a version that satisfies the requirement python-colorama (from versions: )
No matching distribution found for python-colorama
But on ubuntu 18.04
aiki#LAPTOP-886AEJJG:~/Jarvis$ ./setup.sh
Specify python version(2/3)(Default-3)3
Selected python version 3
Running virtualenv with interpreter /usr/bin/python3
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/virtualenv.py", line 22, in <module>
import distutils.spawn
ModuleNotFoundError: No module named 'distutils.spawn'
I hope anyone can help, but please read the GitHub first so you can understand what im trying to do.
I managed to solve this problem by simply update pip with
python -m pip install -U pip
then ran again the install command.

How to install module tf0to1 in python3.5 operating system windows 10

I am trying to upgrade vactorized_graph.py using below command which gives me an error
C:\Python35>python tf_upgrade.py --infile vectorized_graph.py --outfile
vectorized_graph_1.py
Traceback (most recent call last):
File "tf_upgrade.py", line 21, in <module>
from tf0to1.core import Tensorflow0To1Transformer
ImportError: No module named 'tf0to1'
and when I try to install module tf0to1, I get below error.
C:\Python35\Scripts>pip3 install tf0to1
Collecting tf0to1
Could not find a version that satisfies the requirement tf0to1 (from
versions: )
No matching distribution found for tf0to1
(I have already installed module redbaron)
Any suggestion?

Error installing paramiko using pip

I am trying to install paramiko using pip. It shows the following long list of error messages after installation. The message here Details here.
Running pip freeze show the paramiko package on the installation list but it is not working.
Trying to run a simple paramiko program shows following error again
Traceback (most recent call last):
File "paramikoBasic.py", line 1, in <module>
import paramiko
File "/home/tara/taraproject/scripttest/paramiko_test/myenv/local/lib/python2.7/site-packages/paramiko/__init__.py", line 30, in <module>
from paramiko.transport import SecurityOptions, Transport
File "/home/tara/taraproject/scripttest/paramiko_test/myenv/local/lib/python2.7/site-packages/paramiko/transport.py", line 33, in <module>
from cryptography.hazmat.backends import default_backend
ImportError: No module named cryptography.hazmat.backendsled
I even tried to install cryptography separately but that even didn't solve the problem. Installed libffi too but that also didn't work out.
I am guessing you are using ubuntu since it's a common problem
The cffi module is dependent on libffi and libffi-dev.
If you search for current version using
apt-cache search libffi
you should be able to get latest version.
Currently you can install as
sudo apt-get install libffi6 libffi-dev
Also you need to install python-dev and crypto packages as logs indicates.
Credit: https://gist.github.com/tchalvak/a230f8b759875748240d
Cheers

Python 2.7 Bloomberg blpapi import error on Mac OS X Sierra

After successful installation of the pybgg, when tried to run
$python test_pybbg.py
Got the following error message:
ImportError: No module named blpapi
MacBook:pfinance Allen$ which python
/Users/Allen/anaconda/bin/python
MacBook:pfinance Allen$ python test_pybbg.py
Traceback (most recent call last):
File "test_pybbg.py", line 2, in
import pybbg
File "/Users/Allen/anaconda/lib/python2.7/site-packages/pybbg/init.py", line 8, in
from .pybbg_k import Pybbg
File "/Users/Allen/anaconda/lib/python2.7/site-packages/pybbg/pybbg_k.py", line 8, in
import blpapi
ImportError: No module named blpapi
I used $pip list, but failed to see blpapi from the output list.
Any suggestions on how to fix my problem?
Thanks in advance
Ps. The followings show my installation log
MacBook:pfinance Allen$ pip install git+https://github.com/hubertrogers/pybbg
Collecting git+https://github.com/hubertrogers/pybbg
Cloning https://github.com/hubertrogers/pybbg to /private/var/folders/c6/7s88m85x0fj7l0zc52y_kcbh0000gn/T/pip-XagRDz-build
Installing collected packages: pybbg
Running setup.py install for pybbg ... done
Successfully installed pybbg-0.0.1
Based on the post I have set the library links properly;
MacBook:pfinance Allen$ echo $DYLD_LIBRARY_PATH
/Users/Allen/pfinance/blpapi_cpp_3.8.1.1/Darwin/
MacBook:pfinance Allen$ echo $BLPAPI_ROOT
/Users/Allen/pfinance/blpapi_cpp_3.8.1.1

how to install notify2 module in python 3.5 with my MAC computer?

tried the following command in the terminal,
$ pip3 install notify2
Collecting notify2
Using cached notify2-0.3.tar.gz
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/private/var/folders/fr/hgx7qkc14dsglj7724_9m5780000gn/T/pip-build-0aoqwq0g/notify2/setup.py", line 2, in <module>
import notify2
File "/private/var/folders/fr/hgx7qkc14dsglj7724_9m5780000gn/T/pip-build-0aoqwq0g/notify2/notify2.py", line 38, in <module>
import dbus
ImportError: No module named 'dbus'
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in /private/var/folders/fr/hgx7qkc14dsglj7724_9m5780000gn/T/pip-build-0aoqwq0g/notify2/
So, it seems like I need to install dbus module first. So, I tried
$ pip3 install dbus
Collecting dbus
Could not find a version that satisfies the requirement dbus (from versions: )
No matching distribution found for bus
tried which pip
$ which pip
/Library/Frameworks/Python.framework/Versions/3.5/bin/pip
And does anyone know what shall I do?
You need to install dbus using brew install dbus and then pip install dbus-python

Categories