I'm trying to install the gekko module in my python terminal using
python install -m pip gekko
but it is throwing an error not recognizing pip:
can't open file 'pip': [Errno 2] No such file or directory.
I'm using the terminal in Pycharm with Python 3.7
You may have just switched the order:
python -m pip install gekko
Installing from the command line with pip is okay as well:
pip install gekko
If you have multiple versions of Python (such as 2.7 and 3+), sometimes you want to specify that it is for Python 3+:
pip3 install gekko
Another way to install Gekko in Python is to install from a Python script:
try:
from pip import main as pipmain
except:
from pip._internal import main as pipmain
pipmain(['install','gekko'])
although this isn't the preferred option. See Installing python module within code
I figured out the problem: apparently in later versions of Python (I'm using 3.7) the string for the terminal doesn't need python. I also didnt need to use the -m do declare pip a module as it isn't a module.
The string that worked:
pip install gekko
I was facing the same problem, but
$python -m pip install gekko
worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With