I'm running with python3, but when I do pip3 install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./ I get
/usr/lib/python3/dist-packages/pip/commands/install.py:212: UserWarning: Disabling all use of wheels due to the use of --build-options / --global-options / --install-options.
cmdoptions.check_install_build_global(options)
Processing /home/loreto/apex
Running setup.py (path:/tmp/pip-omtf7yt4-build/setup.py) egg_info for package from file:///home/loreto/apex
Running command python setup.py egg_info
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-omtf7yt4-build/setup.py", line 5, in <module>
from pip._internal import main as pipmain
ModuleNotFoundError: No module named 'pip._internal'
Cleaning up...
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-omtf7yt4-build/
Exception information:
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/pip/basecommand.py", line 215, in main
status = self.run(options, args)
File "/usr/lib/python3/dist-packages/pip/commands/install.py", line 342, in run
requirement_set.prepare_files(finder)
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 380, in prepare_files
ignore_dependencies=self.ignore_dependencies))
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 634, in _prepare_file
abstract_dist.prep_for_dist()
File "/usr/lib/python3/dist-packages/pip/req/req_set.py", line 129, in prep_for_dist
self.req_to_install.run_egg_info()
File "/usr/lib/python3/dist-packages/pip/req/req_install.py", line 439, in run_egg_info
command_desc='python setup.py egg_info')
File "/usr/lib/python3/dist-packages/pip/utils/__init__.py", line 725, in call_subprocess
% (command_desc, proc.returncode, cwd))
pip.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-omtf7yt4-build/
so when to force "python setup.py egg_info" to be "python3 setup.py egg_info"
[UPDATE]
I have tried to update python alternatives so that python now points to python3:
$ pip3 --version
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
$ python3 -m pip --version
pip 9.0.1 from /usr/lib/python3/dist-packages (python 3.6)
$ python3 --version
Python 3.6.9
$ python --version
Python 3.6.9
but I get the same error: pip.exceptions.InstallationError: Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-1fxihlyu-build/
The only solution was re-installing pip from scrach:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py --force-reinstall
cd apex/
sudo pip3 install .
Most helpful comment
The only solution was re-installing
pipfrom scrach: