This question already has answers here:
Python 3: ImportError "No Module named Setuptools"
(22 answers)
Closed 8 years ago.
I'm new to python and have just installed the Python 3, I'm new to Python and I'm facing difficulties in importing a new library.
I'm trying to import tweepy-master library into python, I read the instructions given on their github page and did the "python setup.py install" command in command prompt (on windows 8), but I get the error which I've mentioned above,
Guys, please help, is there a separate library called setuptools which I need to install first?
It seems that you should use Setuptools, i.e. Distribute is deprecated:
Distribute is a deprecated fork of the Setuptools project. Since the
Setuptools 0.7 release, Setuptools and Distribute have merged and
Distribute is no longer being maintained. All ongoing effort should
reference the Setuptools project and the Setuptools documentation.
Obsolete
You should use distribute - a setuptools fork which "offers Python 3 support".
Installation instructions (according to documentation):
download python-distribute.org/distribute_setup.py (link is broken, obsolete information)
run it: python distribute_setup.py
It is recommended to install pip too: easy_install pip
Related
This question already has answers here:
Can't install time module
(12 answers)
Closed 3 months ago.
My python wont install Time Module it was asking me to update my pip to newest, and I did.
I receive this error:
ERROR: Could not find a version that satisfies the requirement time (from versions: none) ERROR: No matching distribution found for time
My python verstion is the latest. Python 3.11.0
Pip version : 22.3.1
It's all to date..
any ideias why?
Tried installing via CMD and pycharm packages additions.
Also updated python and pip. no sucess.
The time module is part of Python's standard library. It's installed along with the rest of Python, and you don't need to (nor can you!) install it with pip.
This question already has answers here:
What is the purpose of "pip install --user ..."?
(9 answers)
Closed 8 months ago.
Since company's computer require admin right / presmission when installing anythings, is there any method using extend python libraries without installing (e.g. selenium, requests, beautifulsoup4, PyPDF2 and OpenPyXL).
Go to PyPI
find your package,
go to the Home at the left sidebar (most of them redirected to GitHub or GitLab)
then download the repository and install the package locally, something like this:
pip install /home/yourname/requests
pip install directory_of_setup.py
or use the package without installing it, import the source code to your project
This question already has answers here:
Python (Win 10): Installing matplotlib requires packages "freetype" and "png"?
(4 answers)
Closed 6 years ago.
I'm trying to install freetype (and libpng) for using matplotlib.
I download the tar.gz files and decompress them.
But now i don't know what to do... Usually I use "python setup.py install" but there is no setup.py file.
For Windows, this is not a convenient way to install the dependencies. Use a package manager such as Anaconda.
See this answer for reference.
This question already has answers here:
Why does "pip install" inside Python raise a SyntaxError?
(7 answers)
Closed 6 years ago.
New to Python here. I am running Python 2.7.7 x86 and Windows 7. I am trying to install the requests module. I've tried:
pip install requests
in the Python shell and in the Windows command line (cmd) (I saw this question, which suggested using cmd), and I keep getting the same error:
SyntaxError: invalid syntax
I tried to check if pip even installed correctly by running:
installed_packages = pip.get_installed_distributions()
installed_packages_list = sorted(["%s==%s" % (i.key, i.version) for i in installed_packages])
print installed_packages_list
Which I got from this question. I got [] as the output. I'm interpreting this to mean that pip wasn't successfully installed. I tried reinstalling pip by running get-pip.py, and got the output:
Requirement already up-to-date: pip in c:\python27\lib\site-packages
Cleaning up...
Which I'm interpreting as Python telling me pip was installed. I'm really confused now... how do I make sure pip is correctly installed, and then install the requests module? Any help would be appreciated.
This is a commonly asked question, and one for which there's hardly a canonical answer that would be on-topic for SO (honestly this is more a Superuser thing, but since it's pertinent to coding -- even though it's NOT coding by any means -- it will fly here).
If you have pip (by running get-pip.py or etc) it will exist in your Python directory. If you're running Python 2.7, let's assume that that directory lives at C:\Python27\. In which case, pip exists at C:\Python27\scripts\pip.exe.
You can add that to your %PATH%, or navigate there each time you want to use pip. Whatever is most convenient. If nothing else:
COMMAND PROMPT WINDOW:
C:\users\yourname>set PATH = %PATH%;C:\python27\scripts
C:\users\yourname>pip install requests
I have a program that uses dateutil from the package index. I would like to have setup.py check for for its presence and try to get it using easy_install if it is not there.
The documentation for distutils seems to indicate that this can be done using the requires keyword in setup(), but when I try, it installs on a system without dateutil without giving a warning or installing the required package.
The only thing I could find on google was this blog post about the same issue which did not have any answer either.
Am I using distutils wrong? Do I need to subclass distutils.command.install and do the checking/installing myself?
Automatic downloading of dependencies is a feature introduced by setuptools which is a third-party add-on to distutils, in particular, the install_requires argument it adds. See the setuptools documentation for more information.
Another option is to use requirements.txt file with pip rather than using easy_install as a package installer. pip has now become the recommended installer; see the Python Packaging User Guide for more information.
Update [2015-01]: The previous version of this answer referred to the distribute fork of setuptools. The distribute fork has since been merged back into a newer active setuptools project. distribute is now dead and should no longer be used. setuptools and pip are now very actively maintained and support Python 3.
The argument install_requires in setup function from distutils work for me well, only if I create sdist distributive, like: python setup.py sdist