PyCharm install package with square brackets [duplicate] - python

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!

Related

What can I do to install Pygame? [duplicate]

This question already has answers here:
How to install pygame?
(4 answers)
Unable to install Pygame using pip
(27 answers)
Closed 22 days ago.
I can't use pygame package in Pycharm. I have installed it with pip but I can not use it. When I tried to install it from the error that appeared in the IDE or from 'Python Packages', it gave me an error. I also tried pip install pygame --pre and it's not working. It says that 'Requirement already satisfied:' but I still can not use it. What should I do?
You should be able to left click on the module. It will display a download packages button. You need internet but should be able to download it. You don't to use the command prompt to install packages. That is only for the python IDLE.
Go here and click install. Pycharm using his own registry of packages.
https://imgur.com/a/AZvsBxJ
So, you're using PyCharm, it likely means it has created a new virtual environment when you created your project, to install packages in that environment it's easiest to either use PyCharm's Package Manager or Terminal. In the case of using Python 3.11 you'd need to supply the --pre flag when installing pygame because the full release of 2.1.3 has not yet been released and 2.1.3.dev8 which is a pre release is the latest one that has 3.11 wheels for installation. More information about that particular thing can be found here: https://stackoverflow.com/a/74188087/14531062
So, on PyCharm you'd want to use the Terminal:
When you switch to it, you'll likely find that it basically is PowerShell (unless you have changed it to use CMD which I doubt) (you'll see PS at the start of each line) so the easiest steps to install pygame would be to type in these commands in this order (press the enter key after each line):
cmd
venv\scripts\activate
pip install pygame --pre
After running these commands pygame should be installed in the correct environment and you should be able to import it without any issues.
Screenshot of how it might look when you follow the steps:

pip install pyodbc is not working on python [duplicate]

This question already has answers here:
Why does "pip install" inside Python raise a SyntaxError?
(7 answers)
Closed 2 years ago.
I installed Python on my Windows 10 computer
when I try to run my python code
I get error
ModuleNotFoundError: No module named 'pyodbc'
I checked multiple questions here and the solution is to pip pyodbc
I tried that
pip install pyodbc
but i get error
SyntaxError: invalid syntax
I checked similar propblems here and it seems that pip is not installed.
I unistalled and reinstalled python from python.org and still same issue!
any solution?
Edit
I did as suggested to try from command prompt
but still same error
I installed Python with ticking the option to include environment variables option.
Edit 2 :
I think the problem was that I was trying to install from witthin python.
I misunderstood the answers, I have to run pip as an application outside of python. to allocate pop.exe and then do pip install.
You are trying to install the package from python interpreter (IDLE) which is wrong. You should only import package from IDLE terminal (python session) which IDLE has access to.
Try this link to install the package --> https://pip.pypa.io/en/latest/installing/
You would run pip from a shell, not from the IDLE. However, pyodbc requires the Microsoft ODBC Driver. More information about installing the pyodbc module can be seen in this guide. This Stack Overflow answer can also help.
Normally, you run pip from a shell, not from a Python interactive session.
C:\PATHTOPYTHON\python.exe pip install <<SOMEPACKAGE>>
See the following thread, if you want to install from within a Python interactive session.

How do I install matplotlib on pyCharm [duplicate]

This question already has answers here:
Can't install matplotlib to pycharm
(3 answers)
Closed 2 years ago.
I'm new to python and I'm using PyCharm as my IDE. I've been able to successfully install other packages like numpy, pandas etc. However, when I'm installing matplotlib, I keep getting the error:
src/checkdep_freetype2.c(5): fatal error C1189: #error: "FreeType version 2.3 or higher is required. You may set the MPLLOCALFREETYPE environment variable to 1 to let Matplotlib download it."
I installed it through the command prompt and it installed correctly but (I believe) PyCharm creates it's own environment and does not recognize packages installed through command prompt even though I tried to install them in the same path as other packages in PyCharm. Can you please help?
I had to run the command "pip install updates" and after that I could install the matplotlib package. It turns out that my pip wasn't of the latest version.

import pygame no module named 'pygame' [duplicate]

This question already has answers here:
Python error "ImportError: No module named"
(37 answers)
Closed 3 years ago.
I'm using a mac and typed
pip install pygame
into my terminal.
The terminal said the download was successful, but when I use
import pygame
in IDLE, I get an error.
I've looked at questions similar to this one and have not found an answer. Does anyone know what the problem could be?
Your terminal is referring to a different environment that the one that your IDLE environment refers to. For example Pycharm saves its python packages in the venv folder by default. Pip installing a package through the terminal would not allow you to import the package inside pycharm because you have not installed it in the venv environment.
To fix this, I believe you should use the command
source activate
in order to activate the environment that IDLE is running. You should be able to install it, and import it then.

problem arising while installing pandas library in python [duplicate]

This question already has answers here:
'pip' is not recognized as an internal or external command
(40 answers)
Closed 3 years ago.
i am installing pandas for python on windows 10.
this is the code i am typing in cmd:
pip install pandas
normally this should have led to the installation of pandas. however, i am getting the following error in cmd:
C:>pip install pandas
'pip' is not recognized as an internal or external command,
operable program or batch file.
i have installed anaconda before.
I would first guess that pip is not installed. Which version of Python are you using? Is python set in your path correctly?
If python 3, pip should be installed, not always the case with python 2. You can use this
https://bootstrap.pypa.io/get-pip.py. This should set you straight.
OS : Widwos
Follow the link "https://www.liquidweb.com/kb/install-pip-windows/" to install pip

Categories

Resources