Cannot install openpyxl (ImportError: setuptools) - python

I am new to Python so sorry if the question is trivial. I need to work with python and Excel tables, therefore I was looking to install Openpyxl. I downloaded the .tar.gz pack and unizipped with Peazip, went to the terminal, set the directory to where the setup.py file is and run "py setup.py install". What I get is the following error:
C:\Python27\openpyxl>py setup.py install
Traceback (most recent call last):
File "setup.py", line 30, in <module>
from setuptools import setup, Extension, find_packages
ImportError: No module named setuptools
I did not modify anything with the files I downloaded, this is the folder I am running the code in:
http://i.stack.imgur.com/cxPwM.png
What could the problem be?

It seems that setuptools is not installed on your system, try installing it: https://pypi.python.org/pypi/setuptools

You can try this first: pip install setuptools, and then try to install what you want.

Related

I don't understand why I keep getting ModuleNotFoundError

I have this package, setuptools, installed on my local machine as you will in the command line code attached, but I don't understand why I keep getting the modulenotfound error.
PS C:\Users\MY PC\desktop\django-polls> easy_install --version
setuptools 41.2.0 from c:\users\my pc\appdata\local\programs\python\python38\lib\site-packages (Python 3.8)
PS C:\Users\MY PC\desktop\django-polls> python setup.py sdist
Traceback (most recent call last):
File "setup.py", line 1, in <module>
from setuptools import setup
ModuleNotFoundError: No module named 'setuptools'
PS C:\Users\MY PC\desktop\django-polls> pip install setuptools
Requirement already satisfied: setuptools in c:\users\my pc\anaconda3\lib\site-packages (52.0.0.post20210125)
PS C:\Users\MY PC\desktop\django-polls> python setup.py sdist
Traceback (most recent call last):
File "setup.py", line 1, in <module>
from setuptools import setup
ModuleNotFoundError: No module named 'setuptools'
PS C:\Users\MY PC\desktop\django-polls>
If you are using a virutal environment that may be the reason you are experiencing this. Try installing the package while the VE is active.
However, I am learning Django myself but figured I would give it a shot. Good luck.
This may not work but did you try to install it in the working directory I see you have it in the "my pc" directory
Try to install it in the working directory of "django-polls" and check whether it works or not.
Let me know if that does anything for you.
It looks you are not in virtual environment, please try to create new or use existing virtual environment and install all required package including django in it.

pip and setup.py install don't install actual modules, only egg-info

I've made two packages (pphp and xmlx) and distributed and uploaded them the standard way, using python setup.py sdist bdist_wheel and twine upload dist/*.
I then tried installing them using pip install, and it seemed to work fine... but then, in the interactive shell:
>>> import xmlx
Traceback (most recent call last):
File <module>, line 1:
import xmlx
ImportError: No module named xmlx
I then tried python setup.py install but same result (seemed fine but didn't work).
So what's going on?
This is the repository for xmlx, yes? Your setup.py declares the packages in your project with packages=find_packages(), but your project does not contain any import packages, only a single-file module, xmlx.py. This must be declared in your setup.py by instead writing:
py_modules=['xmlx']
(Also, dist/ and *.egg-info/ are build artifacts and should not be stored in version control; I recommend adding them to your .gitignore.)

Not able to install the python-module numpy

After hours of trying I'm still not able to install numpy. I READ LOTS OF HINTS, ANSWERS USW. BUT IT DOESN'T HELP.
Furthermore I have windows 7, 32 bit, Python 27.
What I did:
download numpy-1.10.2.zip:
http://sourceforge.net/projects/numpy/files/
unzip it
start the windows command prompt and input:
cd C:\Users\myname\Desktop\numpy-1.10.2
now it appears:
C:\Users\myname\Desktop\numpy-1.10.2>
I input:
python setup.py install
and there appears an error:
Running from numpy source directory.
Traceback (most recent call last):
File "setup.py", line 263, in <module>
setup_package()
File "setup.py", line 246, in setup_pa
import setuptools
ImportError: No module named setuptools
I hope somebody can help me or even better IS THERE NOT EASIER WAY TO INSTALL NUMPY OR OTHER MODULES??
Building numpy from source on windows is non-trivial. Best use official binaries (http://sourceforge.net/projects/numpy/files/NumPy/1.10.2/) or Gohlke binaries (http://www.lfd.uci.edu/~gohlke/pythonlibs/#numpy) or a distribution like Anaconda or Canopy or WinPython.
You need to install the setuptools package as well. See here.
A more easy way to install python packages is using pip, which resolves package dependencies automatically. See here. Pip should be included in your python installation if you use a recent version.
You should succeed by calling pip install numpy.

Installing eyed3 in windows

trying to install eyed3 under python 2.7.5
I have done a google search and have been following what I found to install eyed3. The instructions were as follows
extract the zip file to a temp folder (filename eyeD3-0.7.3.zip) I
did using a temp folder on my desktop.
In the eyeD3 folder (under src) rename the init.py.in to
setup.py. I did not find _init++.py.in in the eyed3 folder, but
init_.py was,so I assumed this latest version used that file.
In the main folder (I assume eyeD3-0.7.3) run python setup.py.in
install. setup.py.in didnot exist, but I ran it anyway and got the
expected file not found message, however, setup.py did exist so I
executed python setup.py install and got the following Traceback
Traceback (most recent call last): File "C:\Users\Me\Desktop\New
folder\eyeD3-0.7.3\setup.py", line 10, in <module>
paver.tasks.main() File "paver-minilib.zip\paver\tasks.py", line
883, in main File "paver-minilib.zip\paver\tasks.py", line 851,
in _launch_pavement File "pavement.py", line 28, in <module>
import setuptools ImportError: No module named setuptools
a cmd line search of the python 2.7.5 dir and sub-directories did not find setuptools.py, however I did find the following two files
setuptools_build_ext.py and setuptools_extension.py.
Do I need to rename one of these files or do you know what I am doing wrong or what the fix would be?
Thank you
Depending on where you got your Python from, it may not have come with setuptools. In particular, it does not come in the standard Windows installers from Python.org.
Some packages' setup.py scripts have special code that tries to download and install setuptools (or distribute) if it's missing, or that bundles in just enough of setuptools into the package itself. But not all of them do.
The answer is to install setuptools yourself.
While you're at it, you probably want to also install pip, and then you can just pip install . from within the directory, or pip install eyeD3-0.7.3.zip without unzipping, or even just pip install eyeD3 without even downloading. (Among other things, it will also download and install any dependencies that eyeD3 might need.)
In fact, the eyeD3 installation docs explicitly say "Stable releases of eyeD3 are best installed via pip…".

setuptools easyinstall mysql-python-1.2.3

I have read a bunch of threads on setuptools here.
A lot of people seem not to like it very much.
But I need to install MySQL-python-1.2.3. and when I do that I get this error:
MySQL-python-1.2.3 X$ python setup.py cleanTraceback (most recent call last):
File "setup.py", line 5, in <module>
from setuptools import setup, Extension
ImportError: No module named setuptools
So it seems I need setuptools and that it is assumed that it is installed.
On the setuptools python homepage it says:
Setuptools will install itself using the matching version of Python (e.g. python2.4), and will place the easy_install executable in the default location for installing Python scripts (as determined by the standard distutils configuration files, or by the Python installation).
Does this mean it will replace any default easy install from python?
If so I dont want to use it.
If so can I install MySQL-python-1.2.3 without setupttools?
Thanks
You should use virtualenv and pip.
Virtualenv automatically creates a setuptools version within the new environment, so the default one is intact.
You may want to read how the packaging and installing works: 1, 2

Categories

Resources