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

Is it possible to use "proxy" setting available in pip #987

Closed
jeremy886 opened this issue Oct 27, 2017 · 21 comments
Closed

Is it possible to use "proxy" setting available in pip #987

jeremy886 opened this issue Oct 27, 2017 · 21 comments
Labels
Type: Discussion This issue is open for discussion. Type: Enhancement 💡 This is a feature or enhancement request.

Comments

@jeremy886
Copy link

I really like the ease of use of pipenv. But I'm still trying to find my way.

One thing I can't find in pip where I can set the proxy option:
--proxy Specify a proxy in the form [user:passwd@]proxy.server:port

As I often need to work behind a firewall at my workplace (a school).

Describe you environment
  1. Mac Sierra
  2. Python version: Python 3.6.2 | packaged by conda-forge | (default, Jul 23 2017, 23:01:38)
  3. pipenv, version 8.2.5
Expected result

something like:
pipenv --proxy myproxy

Thanks.

@ivechan
Copy link

ivechan commented Oct 28, 2017

I think i would be a long time for pipenv to support it beause pip doesn't support proxy setting.
However, exporting the http_proxy environment variable can do the same thing(before running pipenv).

$ export http_proxy=your_server:port
$ export https_proxy=your_server:port

@erinxocon
Copy link
Contributor

@ivechan pip does support installing from proxy if you pass it --proxy. @nateprewitt @techalchemy Thoughts about adding a proxy section to the pipfile spec?

@erinxocon erinxocon added Type: Discussion This issue is open for discussion. Type: Enhancement 💡 This is a feature or enhancement request. Category: Future Issue is planned for the future. labels Oct 29, 2017
@techalchemy
Copy link
Member

@erinxocon I feel like @kennethreitz wanted to keep as few things as possible in the Pipfile and kept pushing people to set up their pip.conf or pip.ini for things like this. However, that would mean we will have to figure out how to respect those settings for pip-tools as well, and I am not sure how that would work.

@erinxocon
Copy link
Contributor

@techalchemy That's what I was thinking. We could use config files in the root of the project directory, but pip-tools doesn't currently respect that in our code.

@nateprewitt
Copy link
Member

@erinxocon @techalchemy imo we need to respect pip.conf and the fact we aren't is a problem because we're rebuilding a lot of functionality pip should already handle (better) for us. We don't need the file to be in the directory, it's noted by a env variable or the default path established by pip. We just need to add a patch for pip-tools to respect it if it's not.

Also we definitely do not want a proxy entry in the Pipfile, that's user specific and isn't necessarily required. Anything that's system/instance specific should be left on the origin machine.

@kennethreitz
Copy link
Contributor

not being supported, currently

@nitrocode
Copy link

@kennethreitz would you accept a pull request to support this? imho npm has the ideal method:

npm config set https-proxy http://someproxy:8443

That way you can set it and forget it. Unlike pip where you need to use an alias to always add the proxy.

@stmu009
Copy link

stmu009 commented Dec 11, 2018

any update on this?

@fabiomolinar
Copy link

I would also be interested to hear more about this...

@singhgarima
Copy link

Any updates on this issue?

@felixmr1
Copy link

felixmr1 commented Jul 3, 2019

I might as well bumb this again. Any updates?

Right now I can put my proxy in ~/pip/pip.conf or ~/pip/pip.ini (linux or windows). But it would be much better if I just could add my proxy in the pipfile.

@orihomie
Copy link

Any updates? 🤔

@boukenka
Copy link

boukenka commented Sep 4, 2019

Is there any update? What is the current workaround?

@lijinglin3
Copy link

Any updates?

@adamvm
Copy link

adamvm commented Feb 14, 2020

I will say something new: any updates ?

@TTimo
Copy link

TTimo commented Dec 11, 2020

Maybe re-open this?

@Tangogow
Copy link

Bumping. I'm stuck with 2 proxy between me and my Artifactory pypi repo.

Pip does work with --extra-index-url but pipenv with the same URL in the Pipefile doesn't.

@fridex
Copy link
Contributor

fridex commented Mar 26, 2021

Bumping. I'm stuck with 2 proxy between me and my Artifactory pypi repo.

Pip does work with --extra-index-url but pipenv with the same URL in the Pipefile doesn't.

If you have a Pipfile.lock ready, you can try to use micropipenv:

micropipenv install -- --proxy myproxy

If the lock file is not present, micropipenv will not resolve it though.

@jankap
Copy link

jankap commented Mar 14, 2022

pip does support proxy these days...
image
Please add a proxy option to pipenv, I can't rely on environmental variables.

@matteius matteius reopened this Mar 14, 2022
@matteius matteius removed the Category: Future Issue is planned for the future. label Mar 14, 2022
@matteius
Copy link
Member

@jankap I have re-opened this issue based on the amount of interest I am seeing come in around it. Keep in mind I am newer to working on the project, but I've also racked up some serious time on it in the last few months. If anyone wants to take on looking into what it would take to support this in pipenv, I can be of some support. However I am focused in some other more pressing issues and won't be dedicating time to solving this one in the near term.

@matteius
Copy link
Member

matteius commented Jul 6, 2022

I believe this is resolved now with my work on index restricted packages. Correct me if I am wrong, but the proxy feature was specifically about using an alternate address (a proxy) on the internal network to bypass a firewall and connect to somewhere outside the network. Since index restricted packages requires that all packages use a specific index, wouldn't it work to just specify the proxy address for that source in the Pipfile?

So for example:

[[source]]
url = " https://<usr_name>:<password>@<proxyserver_name>:<port#>"
verify_ssl = true
name = "my-proxy"

[packages]
requests = "*"

[dev-packages]

[requires]
python_version = "3.10"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Type: Discussion This issue is open for discussion. Type: Enhancement 💡 This is a feature or enhancement request.
Projects
None yet
Development

No branches or pull requests