Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how can i use pip search with my own nexus pypi repo?

I deploy a nexus repo sys in my local area network, and I config a PyPI repo on it. I can use pip install to install package with my private mirror. But I cannot use pip search.

Here is my pip.ini

[global]
index-url = http://nexus.repo.com/repository/PyPI/simple
index = http://nexus.repo.com/repository/PyPI/pypi
trusted-host = nexus.repo.com

And when I use pip search it returns:

C:\Users\user>pip search redis
HTTP error 404 while getting http://nexus.repo.com/repository/PyPI/pypi
Exception:
Traceback (most recent call last):
File "c:\python27\lib\site-packages\pip\basecommand.py", line 215, in main status = self.run(options, args)
File "c:\python27\lib\site-packages\pip\commands\search.py", line 45, in run pypi_hits = self.search(query, options)
File "c:\python27\lib\site-packages\pip\commands\search.py", line 62, in search hits = pypi.search({'name': query, 'summary': query}, 'or')
File "c:\python27\lib\xmlrpclib.py", line 1243, in call return self.__send(self.__name, args)
File "c:\python27\lib\xmlrpclib.py", line 1602, in __request verbose=self.__verbose
File "c:\python27\lib\site-packages\pip\download.py", line 776, in request response.raise_for_status()
File "c:\python27\lib\site-packages\pip_vendor\requests\models.py", line 862, in raise_for_status raise HTTPError(http_error_msg, response=self)
HTTPError: 404 Client Error: Not Found for url:http://nexus.repo.com/repository/PyPI/pypi
C:\Users\user>

I'm googling and googling, but coming up empty so far. So here I am, hoping someone else can guide me through this. thank you very much.

like image 754
Zander Wong Avatar asked Jan 17 '18 15:01

Zander Wong


People also ask

How do I search using pip?

pip search Looking for a package, pip is there to help you out. pip search allows you to search PyPI for any package using the pip search <package> command. The result of the command returns the name and description of all the matching packages.

Does pip use PyPI?

Using a Custom Package Index. By default, pip uses PyPI to look for packages.


1 Answers

Try this: pip search redis -i http://nexus.repo.com/repository/PyPI/pypi -vvv --trusted-host nexus.repo.com

I had the same problem, and found that I was basically searching with the /simple url, rather than the /pypi one (the /simple one works only for pip install)

like image 129
dbs.83 Avatar answered Sep 28 '22 10:09

dbs.83