0

I have downloaded a wheel file for Python module. The .whl file is now in the same folder where Scripts folder is located. C:/Python27. The name of the .whl file is shown as below:

pandas-0.22.0-cp37-cp37m-win_amd64.whl

Please tell me how to use pip for installing the .whl file in Python console (not the command line). Something similar to installing tweepy.

C:\Python27\ArcGIS10.5>python2.exe
>>> import pip
>>> pip.main(['install','tweepy'])
Mark Rotteveel
  • 82,132
  • 136
  • 114
  • 158
Kana
  • 1
  • 1
  • 2

3 Answers3

0

You can find the answer here!

I'm citing the answer I've linked:

I just used the following which was quite simple. First open a console then cd to where you've downloaded your file like some-package.whl and use

pip install some-package.whl

Note: if pip.exe is not recognized, you may find it in the "Scripts" directory from where python has been installed. If pip is not installed, this page can help: https://stackoverflow.com/questions/4750806/how-to-install-pip-on-windows

Note: for clarification
If you copy the *.whl file to your local drive (ex. C:\some-dir\some-file.whl) use the following command line parameters --

pip install C:/some-dir/some-file.whl
csabinho
  • 1,451
  • 1
  • 13
  • 22
0

In your windows explorer, go to the directory where you have wheel.exe installed, if you don't type pip install wheel.exe in you command prompt. Once in the folder where you have wheel.exe, create a document using notepad, title local.bat. This creates a command prompt directed to that specific folder. Open this, and type: pip install your_file.whl.

flame boi
  • 33
  • 9
0
import pip._internal as pip
package_names=['name_of_package', 'requests']
pip.main(['install'] + [package_names] + ['--upgrade'])

  • Please don't post only code as an answer, but also provide an explanation of what your code does and how it solves the problem of the question. Answers with an explanation are usually more helpful and of better quality, and are more likely to attract upvotes – Ran Marciano Apr 07 '21 at 05:17