How do I install modules in Python on Windows? [duplicate] - python

This question already has answers here:
Closed 11 years ago.
Possible Duplicate:
Installing modules in Python on Windows
The instructions in the documentation aren't helping. How do I install a module in Python?

If there is setup.py source file in module directory, run windows command line utility, change current directory to module directory and write
python setup.py install
make sure that python bin directory is in your system path variable

The same as everywhere, use easy_install. (Still it is somewhat more difficult to use under Windows because the cmd shell is far less powerful than bash)

You could try using pip

Related

Why python didn't see nltk module? [duplicate]

This question already has answers here:
How do I use installed packages in PyCharm?
(14 answers)
Closed 4 months ago.
I cant run my programm because nltk module is missing but i just intstalled it and it just right here in the folder
I tried to reinstall my python, and tried to change python interpreter but nothing worked
How have you actually installed nltk?
You can check if it's actually installed with pip freeze.
What might be happening here is that you could have another version of python installed, so make sure that you actually call the same interpreter for checking and installing with pip, in your case E:/pythonProject1/Scripts/python.exe -m pip freeze and E:/pythonProject1/Scripts/python.exe -m pip install nltk

PyCharm install package with square brackets [duplicate]

This question already has answers here:
'pip' is not recognized as an internal or external command
(40 answers)
Closed 1 year ago.
I want to install "stabe-baselines3[extra]"
But in the PyCharm Package installer is only "stable-baselines3" available.
When try to install it via 'pip install' I do get this error:
Translation: 'pip' is not recognized as an internal or external command
How do I get the [extra]?
From: https://github.com/DLR-RM/stable-baselines3
So are you actually needing that additional functionality for atari games?
If so, then you can just use the built-in Terminal to manually install the package you are needing:
Which if you didn't already know, can be found right here:
Otherwise, you can just use stable-baselines3, as you have already found is available within the package manager.
The terminal has to be used. Reason the terminal hasn't worked is because in the settings 'Start directory' hasn't been the Python Scripts folder but the main-file folder.
After that folder change the pip install command worked!

Installed Python 3.8.5, but my terminal still detects Python 2.7 (Catalina on mac) [duplicate]

This question already has answers here:
Dealing with multiple Python versions and PIP?
(28 answers)
Closed 2 years ago.
I was trying to install biopython with pip, but I get an error saying Python 3.6 or later is required, but 2.7 was detected. Weirdly though, when I look for my python version, it indicates I have 3.8.5 installed.
Should I move directories somehow? I just upgraded my Catalina version and did a thorough cleanup on my mac. Maybe I accidentally moved a file or two?
here's what my terminal looks like
Thank you!!!!!
You have to deconflict pip and make sure you're using the right one. There's a good answer on another Stack Overflow question.
The bottom line is, you might try:
which -a pip
to see all pip installations in your path.
You can use a specific version of pip like this:
python3 -m pip install something
or, I think you can also do:
pip3.6 install something

Using a python package [duplicate]

This question already has answers here:
How to install Python packages from the tar.gz file without using pip install
(7 answers)
Closed 5 years ago.
I have downloaded the tar file of the Python geohash package
I import functions from this package to use them inside my python programs. It works completely fine, but only inside its own folder, where it is extracted.
If I intend to use this package in any other location, it doesn't simply import that package.
What should I do if I want to use it anywhere in my system ?
(the package is only available through this tarfile, not through pip/sudo apt-get)
Simply untar/unzip the file and make sure you have setup.py visible. From you command prompt in windows or linux. Go to the dir of the package which you just unzipped/untarred and dir/ls to make sure that setup.py is there and then do the following:
If you are using virtualenv:
/path-to-your-venv/venv/bin/python setup.py install
If you are not using virtualenv
python setup.py install

Finding out the Python used to install the current package? [duplicate]

This question already has answers here:
Find full path of the Python interpreter?
(3 answers)
Closed 6 years ago.
Is there a way to programmatically find which Python version was used to install the current package?
If you have a package called mypackage and it has in its setup.py something like:
scripts = ["myscript.py"]
suppose install the package with easy_install or pip using a particular Python version, Python 2.x:
/usr/local/bin/python2.x setup.py install
Then in myscript.py, how can you find out that it was /usr/local/bin/python2.x that was used to install mypackage from myscript.py as opposed to some other Python version available on the system? I'd like to know the full path and not just the version info because I want to use /usr/local/bin/python2.x in my script.
Use sys.executable.
A string giving the absolute path of the executable binary for the
Python interpreter, on systems where this makes sense. If Python is
unable to retrieve the real path to its executable, sys.executable
will be an empty string or None.
Have a look at sys.version or sys.version_info.

Categories

Resources