Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

problem about --install-option #7512

Closed
somewheve opened this issue Dec 25, 2019 · 10 comments
Closed

problem about --install-option #7512

somewheve opened this issue Dec 25, 2019 · 10 comments
Labels
auto-locked Outdated issues that have been locked by automation resolution: duplicate Duplicate of an existing issue/PR type: support User Support

Comments

@somewheve
Copy link

Environment

  • pip version:19.3.1
  • Python version:3.7
  • OS:Arch Linux

Description
try to extend install-option by using cmdclass when installing the package, the --install-option will be passed by to dependent libraries

Expected behavior
the --install-option only be passed to the current package

How to Reproduce
https://github.com/ctpbee/ctpbee/blob/dev/setup.py
1.clone the dev branch
2.cd ctpbee
3.pip install .[QA_SUPPORT] --install-option="--fix=true" --install-option="--uri=https://mirrors.aliyun.com/pypi/simple"
Error will occurs!

python setup.py install --fix=true --uri=https://mirrors.aliyun.com/pypi/simple
will work correctly

Output

Installing collected packages: pandas, ctpbee
    Running setup.py install for pandas ... error
    ERROR: Command errored out with exit status 1:
     command: /home/somewheve/PycharmProjects/ctpbee/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-4rs9kjxz/pandas/setup.py'"'"'; __file__='"'"'/tmp/pip-install-4rs9kjxz/pandas/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-5tef09dz/install-record.txt --single-version-externally-managed --compile --install-headers /home/somewheve/PycharmProjects/ctpbee/venv/include/site/python3.7/pandas fix=true uri=https://mirrors.aliyun.com/pypi/simple
         cwd: /tmp/pip-install-4rs9kjxz/pandas/
    Complete output (1 lines):
    invalid command name 'fix=true'
    ----------------------------------------
ERROR: Command errored out with exit status 1: /home/somewheve/PycharmProjects/ctpbee/venv/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-4rs9kjxz/pandas/setup.py'"'"'; __file__='"'"'/tmp/pip-install-4rs9kjxz/pandas/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-5tef09dz/install-record.txt --single-version-externally-managed --compile --install-headers /home/somewheve/PycharmProjects/ctpbee/venv/include/site/python3.7/pandas fix=true uri=https://mirrors.aliyun.com/pypi/simple Check the logs for full command output.

@triage-new-issues triage-new-issues bot added the S: needs triage Issues/PRs that need to be triaged label Dec 25, 2019
@somewheve
Copy link
Author

I try to search for this error. but no answer.

@chrahunt chrahunt added resolution: duplicate Duplicate of an existing issue/PR S: awaiting response Waiting for a response/more information type: support User Support labels Dec 25, 2019
@triage-new-issues triage-new-issues bot removed the S: needs triage Issues/PRs that need to be triaged label Dec 25, 2019
@chrahunt
Copy link
Member

Not passing --install-option to dependencies is tracked by #1883. As a workaround, you can use a requirements.txt, then --install-option on the same line as a package will only be passed to that one package.

@somewheve
Copy link
Author

why not add an option to avoid this error. using a requirements.txt is not a good way for me

@no-response no-response bot removed the S: awaiting response Waiting for a response/more information label Dec 25, 2019
@somewheve
Copy link
Author

maybe we can recognize the user-defined option and ignore it.

@chrahunt
Copy link
Member

why not add an option to avoid this error. using a requirements.txt is not a good way for me

The requirements.txt approach is very straightforward, just make a file like

.[QA_SUPPORT] --install-option="--fix=true" --install-option="--uri=https://mirrors.aliyun.com/pypi/simple"

then do pip install -r requirements.txt. If for some reason you cannot make a file, then if you're using bash you can do something like

pip install -r <(echo '.[QA_SUPPORT] --install-option="--fix=true" --install-option="--uri=https://mirrors.aliyun.com/pypi/simple"')

If you want to fix it for good, I described one way to implement it in pip in #1883 (comment).

maybe we can recognize the user-defined option and ignore it.

pip does not have any control over what the setup.py does, so this is not an approach we can take

@chrahunt chrahunt added the S: awaiting response Waiting for a response/more information label Dec 25, 2019
@somewheve
Copy link
Author

thanks for your reply ^_^

@no-response no-response bot removed the S: awaiting response Waiting for a response/more information label Dec 25, 2019
@somewheve
Copy link
Author

pip install -r <(echo '.[QA_SUPPORT] --install-option="--fix=true" --install-option="--uri=https://mirrors.aliyun.com/pypi/simple"')

I got a problem after executed it, it will download pandas, and get stuck when installing pandas.

but the following command will work normally

pip install pandas

also will show the following output after type the "Enter" key many times

I see it, but the way to add a option maybe I see it, but the way to add a option maybe"

@somewheve
Copy link
Author

the output is pasted by shortcuts, ignore it

@somewheve
Copy link
Author

after a long time. it will successfully finish. but no any output.
like this:

Installing collected packages: pandas, ctpbee
    Running setup.py install for pandas ... |                                                                                                                                           

                                                                                                                                                                                        \


                                                                                                                                                                                        done
  Found existing installation: ctpbee 1.0
    Uninstalling ctpbee-1.0:
      Successfully uninstalled ctpbee-1.0
    Running setup.py install for ctpbee ... done
Successfully installed ctpbee-1.0 pandas-0.24.0
(venv) [somewheve@archlinux ctpbee]$ 
(venv) [somewheve@archlinux ctpbee]$ also will show the following output after type the "Enter" key many times

@somewheve
Copy link
Author

it will try to compile pandas..,,, I see it

@lock lock bot added the auto-locked Outdated issues that have been locked by automation label Jan 24, 2020
@lock lock bot locked as resolved and limited conversation to collaborators Jan 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
auto-locked Outdated issues that have been locked by automation resolution: duplicate Duplicate of an existing issue/PR type: support User Support
Projects
None yet
Development

No branches or pull requests

2 participants