cs01/pythonloc

piploc install causes distutils.errors.DistutilsOptionError

fredrikaverpil opened this issue · 3 comments

I've installed pythonloc on my macOS laptop, running Python 3.7 installed via homebrew:

$ python3 --version

Python 3.7.2

$ pip3 list

Package         Version
--------------- -------
greenlet        0.4.15 
jedi            0.13.2 
msgpack         0.6.0  
neovim          0.3.1  
parso           0.3.1  
pip             18.1   
pydocstyle      3.0.0  
pynvim          0.3.1  
pythonloc       0.1.1.1
setuptools      40.6.3 
snowballstemmer 1.2.1  
wheel           0.32.3 

$ python3 -m pip install --user pythonloc

Collecting pythonloc
  Using cached https://files.pythonhosted.org/packages/02/02/88be53abb689d9570cd391db8c6bfe2137af2aeb63315fd81c04ad7d8911/pythonloc-0.1.1.1-py3-none-any.whl
Installing collected packages: pythonloc
  The scripts pipfreezeloc, piploc and pythonloc are installed in '/Users/fredrik/Library/Python/3.7/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed pythonloc-0.1.1.1

$ /Users/fredrik/Library/Python/3.7/bin/pythonloc --version

Python 3.7.2

$ /Users/fredrik/Library/Python/3.7/bin/piploc list

Package         Version
--------------- -------
greenlet        0.4.15 
jedi            0.13.2 
msgpack         0.6.0  
neovim          0.3.1  
parso           0.3.1  
pip             18.1   
pydocstyle      3.0.0  
pynvim          0.3.1  
pythonloc       0.1.1.1
setuptools      40.6.3 
snowballstemmer 1.2.1  
wheel           0.32.3 


But when I run piploc install, I get an error:

$ /Users/fredrik/Library/Python/3.7/bin/piploc install requests

Collecting requests
  Using cached https://files.pythonhosted.org/packages/7d/e3/20f3d364d6c8e5d2353c72a67778eb189176f08e873c9900e10c0287b84b/requests-2.21.0-py2.py3-none-any.whl
Collecting urllib3<1.25,>=1.21.1 (from requests)
  Using cached https://files.pythonhosted.org/packages/62/00/ee1d7de624db8ba7090d1226aebefab96a2c71cd5cfa7629d6ad3f61b79e/urllib3-1.24.1-py2.py3-none-any.whl
Collecting idna<2.9,>=2.5 (from requests)
  Using cached https://files.pythonhosted.org/packages/14/2c/cd551d81dbe15200be1cf41cd03869a46fe7226e7450af7a6545bfc474c9/idna-2.8-py2.py3-none-any.whl
Collecting certifi>=2017.4.17 (from requests)
  Using cached https://files.pythonhosted.org/packages/9f/e0/accfc1b56b57e9750eba272e24c4dddeac86852c2bebd1236674d7887e8a/certifi-2018.11.29-py2.py3-none-any.whl
Collecting chardet<3.1.0,>=3.0.2 (from requests)
  Using cached https://files.pythonhosted.org/packages/bc/a9/01ffebfb562e4274b6487b4bb1ddec7ca55ec7510b22e4c51f14098443b8/chardet-3.0.4-py2.py3-none-any.whl
Installing collected packages: urllib3, idna, certifi, chardet, requests
Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 143, in main
    status = self.run(options, args)
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 366, in run
    use_user_site=options.use_user_site,
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/req/__init__.py", line 49, in install_given_reqs
    **kwargs
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/req/req_install.py", line 760, in install
    use_user_site=use_user_site, pycompile=pycompile,
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/req/req_install.py", line 382, in move_wheel_files
    warn_script_location=warn_script_location,
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/wheel.py", line 215, in move_wheel_files
    prefix=prefix,
  File "/usr/local/lib/python3.7/site-packages/pip/_internal/locations.py", line 165, in distutils_scheme
    i.finalize_options()
  File "/usr/local/Cellar/python/3.7.2/Frameworks/Python.framework/Versions/3.7/lib/python3.7/distutils/command/install.py", line 248, in finalize_options
    "must supply either home or prefix/exec-prefix -- not both")
distutils.errors.DistutilsOptionError: must supply either home or prefix/exec-prefix -- not both
cs01 commented

Thanks for filing this! I have not tested with python 3.7, but I imagine this is an easy fix. I’ll take a look when I get a chance. Which version of pip are you running?

This was on pip 18.1, but I just updated to 19.0.2 and I get the same error there.

I'm getting the same error today. Python 3.7.3, pip 19.0.3, in macos 10.14.

Any update on a fix for this?