Error installing a python module - python

I am trying to install a python module with the standard python setup.py install but I get the following error. I am fairly new to python but I have been able to install other modules in this way in the past. I am under the impression this module setuptools is not something I am supposed to have gotten separate from my python installation. Do I need to be in a specific directory or something?
Error:
Traceback (most recent call last):
File "setup.py", line 3 in <module>
from setuptools import setup, find_packages
ImportError: No module named setuptools

Apparently, that package requires you to have setuptools to install it. Setuptools is a module that provides easy installation of Python packages. You can get it on pypi, here.

Surprisingly, setuptools does NOT come pre-packaged with Python, despite how often and casually everyone refers to it. I also had this problem when learning Python.
Setuptools is available on the Python Package Index.

Related

Python Module not found when installed with python -m pip install -e <my_package>

I am attempting to install a local directory as a python package, so as to make other modules in the package accessible to each other, similarly to how java files are able to access each other.
python -m pip list | grep sumobot returns:
sumobot 0.1 /home/pi/Documents/sumobot
However, trying to run a file in the package returns this error:
Traceback (most recent call last):
File "tests/test_motor.py", line 1, in <module>
from sumobot.robot_hardware.motor import RawMotor as Motor
ModuleNotFoundError: No module named 'sumobot'
I'd like to understand how this can be the case, as from my reading, installing with python -m pip should fix issues of wrong python versions. Also, if there is a better way to do what I am looking to do, please let me know.
If it makes a difference, I am running this on a raspberry pi zero, and the contents of my setup.py (which was placed in the same directory as my sumobot package) are as follows:
from distutils.core import setup
setup(name='sumobot',
version='0.1',
description='is a sumobot!',
packages=['sumobot'])```

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.

Accidentally installed two versions of Python 3.4.1... Can't run any scripts, no modules can import, how can I fix this?

I was having problems with a 'zlib' import error on Python3.4.1, so I followed the instructions here, but instead of doing it for Python 2.6 I did it for 3.4. I had not uninstalled my existing version of Python3.4 before doing this new installation process. I can now import zlib, however all of my custom packages cannot be imported, such as sklearn, scipy, numpy, flask, and pandas.
First, I get an import error:
>>> import scipy
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
ImportError: No module named 'scipy'
So, I try to remedy the issue with:
pip3 install scipy
But, I am greeted with:
Requirement already satisfied: scipy in /usr/local/lib/python3.4/dist-
packages
Requirement already satisfied: numpy>=1.8.2 in
/usr/local/lib/python3.4/dist-packages (from scipy)
I tried running echo $PYTHONPATH but it returned blank.
I can import sys, os, time, and zlib just fine. It just won't import all of the dependencies that I already have on my computer.
I tried deleting the folder in /tmp where I installed the "newer" Python3.4.1 folder, however this did not work. I don't know how to fix this issue.
I can still run python scripts in an anaconda virtual environment that I had created a while ago, but I can't use virtualenv's, which is a problem since I use zappa a lot (which requires an active virtualenv).
This is what I get when I try to run a virtualenv:
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ModuleNotFoundError: No module named 'encodings'
Current thread 0x00007fb1bc7f4740 (most recent call first):
Aborted (core dumped)
The python version that contains all of my dependencies in dist-packages is located in /usr/local/bin/python3.4. How can I make it so that when I run python3 that it will use the dependencies from that folder? Is the fact that the pythonpath variable is blank bad?
I just want my old python back.
PS. Everything works fine for python2. It's just causing these issues for python3.
I had a similar issue, but with another package. In my case it turned out that I had a egg-info file present in the site-packages without the directory for the package. Deleting the egg-info file (actually I moved it first) allowed a clean install to occur.

Django Taggit Module Installation Error: No module named setup tools

The title basically explains it all.
I am running Windows 8 (windows 7 was previously installed... If it helps with answering) and am using Python 2.7.
Upon using the code:
python setup.py install
I am getting this error:
C:\Users\Nicholas\Desktop\taggit>python setup.py install
Traceback (most recent call last):
File "setup.py", line 52, in
from setuptools import setup
ImportError: No module named setuptools
Any help?
Thanks in advance
Nicholas
You need to install setuptools, which allows packages to be configured for your Python installation. It is not included with the default Python installer.
From this link you can download Windows installers for many Python packages (I have linked it directly to setuptools). Make sure you download the version that matches your Python installation.
in Python 3:
pip3 install setuptools
And in Python 2.x:
pip install setuptools

Installing grab, site scraping library

I was trying to find libraries that would help me for auto form filling . Someone suggested me Grab(a site scraping library) from http://pypi.python.org/pypi/grab/0.4.8 . I uncompressed tar.gz and then tried the following ,
python setup.py install
Traceback (most recent call last):
File "setup.py", line 1, in <module>
from setuptools import setup, find_packages
ImportError: No module named setuptools
Does anyone know how to install it ?
Error is clear and simple.
ImportError: No module named setuptools
Please check, if you've installed setuptools for python3 or python2.
An example on archlinux, (python => python3), (python2 => python2)
Be careful with that
Please try with "python2 setup.py install"

Categories