I am trying to build the python api for an open source project called Zulip and I keep running into the same issue as indicated by the screenshot below.
I am running
To verify whether is your pip
installation problem, try using easy_install
to install an earlier version of pip:
easy_install pip==9.0.1
If this succeed, pip
should be working now. Then you can go ahead to install any other version of pip
you want with:
pip install pip==10....
Or you can just stay with version 9.0.1
, as your project requires version >= 9.0.
Try building your project again.
First run
import pip
pip.__version__
If the result is '10.0.0', then it means that you installed pip successfully
since pip 10.0.0 doesn't support pip.main() any more, you may find this helpful
https://pip.pypa.io/en/latest/user_guide/#using-pip-from-your-program
Use something like
import subprocess
subprocess.check_call(["python", '-m', 'pip', 'install', 'pkg']) # install pkg
subprocess.check_call(["python", '-m', 'pip', 'install',"--upgrade", 'pkg']) # upgrade pkg
Edit: pip 10.0.1 still doesn't support main
You can choose to DOWNGRADE your pip version via following command:
python -m pip install --upgrade pip==9.0.3
Pip 10.0.* doesn't support main.
You have to downgrade to pip 9.0.3.
It works well:
py -m pip install --user --upgrade pip==9.0.3
Edit file: C:\Users\kpate\hw6\python-zulip-api\zulip_bots\setup.py in line 108
to
rcode = pip.main(['install', '-r', req_path, '--quiet'])
do
rcode = getattr(pip, '_main', pip.main)(['install', '-r', req_path, '--quiet'])´
For me this issue occured when I was running python while within my site-packages folder. If I ran it anywhere else, it was no longer an issue.