Python 3.5 No Module named xlrd or pybrain - python

I am working on a project to build a Neural Net in python from an xlrd file, and I am encountering some issues. I have installed xlrd using pip install xlrd, and pybrain by cloning the git repository and running python setup.py install both of which were successful in installing. When I try to run import xlrd or import pybrain from IDLE, it gives the error:
>>> import xlrd
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import xlrd
ImportError: No module named 'xlrd'
and the same thing for pybrain. I only have python 3.5 installed. I am at the end of my rope with this, If anyone can give some insight in to why this may be happening I would be very appreciative.

Had this same problem with Python 3.6. Issue fixed by doing a PIP install of the XLRD.
pip install xlrd

Related

ModuleNotFoundError: No module named 'cryptography'

these are the Error messages I am geeting on running any of my project modules.
Traceback (most recent call last):
File "C:\Users\hsnl\BlockchainCodesTutor\Wallet.py", line 3, in <module>
import Transactions
File "C:\Users\hsnl\BlockchainCodesTutor\Transactions.py", line 2, in <module>
import Signatures
File "C:\Users\hsnl\BlockchainCodesTutor\Signatures.py", line 2, in <module>
import cryptography
ModuleNotFoundError: No module named 'cryptography'
I have already installed the cryptography module and was working perfectly until today I start getting this message that " No module named 'cryptography'".
I have again installed the cryptography as well as pip package but still showing the same error.
There might be loose versions running on your system. Please try the following:
python -m pip uninstall cryptography
python -m pip install cryptography
You can also check out this with python -m to make sure you are not using a loose pip.
You might not have cryptogtaphy installed correctly. I see you are using windows. Open commandline as an administrator and run pip install cryptography again. Enshure that the installation finishes without any errors and consider to restart your python interpreter after installation.
For further help you should post more details like the output of pip and your code leading to the error, so a more detailed answer for your problem can be given.
Try download cryptography whl from here.
Then use pip install cryptography-XXX.whl
For example:
pip install cryptography-3.3.1-cp36-abi3-win_amd64.whl
And now just supports python2.7 and python3.6.

Why do I still get the "module not found" error even after having installed the package using pip install?

I am trying to create an image processing program using convolutions. I need the package scikit-image, specifically this:
from skimage.exposure import rescale_intensity
I have repeatedly installed scikit-image using pip install scikit-image in my terminal (Mac). I did this in the folder where my convolutions.py file is located (is this what is meant by the PYTHONPATH?). However, I always get an error message:
Traceback (most recent call last):
File "Convolutions.py", line 6, in <module>
from skimage.exposure import rescale_intensity
ImportError: No module named skimage.exposure
How do I solve the problem?
make sure you are installing the package on the same version of python which you are running. On a mac, python by default runs python-2.7, and the command python3 runs python-3.x. Also, pip by default installs packages to python-2.7. To install them on python3 try running
python3 -m pip install scikit-image
or simply
pip3 install scikit-image

PyAudio (PortAudio issue) Python

I installed pyaudio with anaconda python. Using conda install pyaudio on windows.
It said it installed and it also installed PortAudio with it.
However, when I create my file and run it now I get the following issue.
I have no idea what is going on.
Could not import the PyAudio C module '_portaudio'.
Traceback (most recent call last):
File "C:\Users\This PC\Desktop\Py\demo.py", line 2, in <module>
import pyaudio
File "C:\Users\This PC\Anaconda3\lib\site-packages\pyaudio.py", line 116, in <module>
import _portaudio as pa
ImportError: DLL load failed: The specified module could not be found.
I ran into this error with win32 py3 using Anaconda3. Re-installing portaudio fixed this:
conda install portaudio
It just updated the package for me, and pyaudio was able to find the DLL then.
I faced a similar issue.
The only way I was able to resolve this was by uninstalling anaconda, installing the latest version of python, and reinstalling the latest version of conda.
I then downloaded the latest .whl file for pyaudio which can be found here: https://www.lfd.uci.edu/~gohlke/pythonlibs/#pyaudio
I moved this file from my downloads and into the site-packages folder of anaconda3:
C:\Users\Projects\Anaconda3\Lib\site-packages
Upon running the command 'pip install pyaudio' OR 'python -m pip install pyaudio' in the anaconda prompt I was good to go
I hope this helps!

Failing to install Python openpyxl module

I have installed the openpyxl Python module in my machine, or at least I thought I've done that. I entered these commands on the command prompt (on Windows):
C:\Users\gluti>cd C:\Users\gluti\PycharmProjects\Data Structures\venv\Scripts
C:\Users\gluti\PycharmProjects\Data Structures\venv\Scripts>pip install openpyxl==2.1.4
And then, it shows a message, saying that the module openpyxl was successfully installed. However, when I try to import this module on Python IDLE, it shows the following error message:
import openpyxl
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import openpyxl
ModuleNotFoundError: No module named 'openpyxl'
Did I miss something or am I installing the module in the wrong directory?
It is possible you have installed python 2 and python 3 so there are two different versions of pip on your machine.
You need to ensure you are installing openpyxl in the same type of python that you are using to run the script.

Python and importing

I installed python 3.4.3 and NLTK-3.0.4. When I import nltk in python, the below error appeared :
Traceback (most recent call last):
File "<pyshell#0>", line 1, in <module>
import nltk
ImportError: No module named 'nltk'
How can I solve this?
I just extract nltk.rar and then copy the folder to the below folder:
C/python34/lib
Note: before copying the folder, you should rename the name of the folder and just remove the numbers.
Before copying = nltk 3.4.3
After renaming = nltk
Following are the instructions from the nltk website.So what's the os you are using
Mac/Unix
Install NLTK: run sudo pip install -U nltk
Install Numpy (optional): run sudo pip install -U numpy
Test installation: run python then type import nltk
For older versions of Python it might be necessary to install setuptools (see http://pypi.python.org/pypi/setuptools) and to install pip (sudo easy_install pip).
Windows
These instructions assume that you do not already have Python installed on your machine.
Install python 3.4 first
Install NLTK: http://pypi.python.org/pypi/nltk
Test installation: Start>Python34, then type import nltk

Categories