1

I have a machine which is a Windows server, where installation by downloading packages from internet is prohibited. Before that I tried to set up Python 2.7 on my windows machine with internet.I have downloaded and installed pysftp, paramiko, bcrypt, cryptography, pyasn, PyNaCl etc. and also have installed Microsoft visual c++ which was required for pyasn. I have updated pip to 9.0.1 as well. But when I tried to set up on another Windows machine with the help of all packages (unzipped and copied to that machine),installation failed always. I have tried with python setup.py install and pip install

So can we install packages without internet connection?

Please help me on this.

Thanks and regards, Shreeram

  • 1
    You need some way to deploy either eggs or wheels to the machine with no connection. Perhaps you have tried that - it's not clear. When you say "with the help of the packages" what does "help" mean? When you say "it failed" what was "it" and what happened? Was there an error? Something else... – doctorlove Jul 05 '17 at 11:54
  • have a look at https://stackoverflow.com/q/11091623/5283213 – Sreetam Das Jul 05 '17 at 12:07
  • @doctorlove - I have tried with the unzipped folders copied to a location in the new machine. And have tried to execute python setup.py install command from the folder's location. The error was mostly when the process of installation tried to download a few files. I got those files downloaded and copied too. Still a few error persists. The most important one was about missing MS VC++ – shreeram shankar pattanayak Jul 05 '17 at 12:11
  • You need to set things up in the right order, and produce a wheel (or eggs etc) yourself elsewhere and send *that* to the machine in question - so use MS VC elsewhere and send its output to the machine. – doctorlove Jul 05 '17 at 12:29
  • @doctorlove-Please have a look at the errors `D:\Python_Back_up\pyasn-1.6.0b1\pyasn-1.6.0b1>python setup.py install error: Microsoft Visual C++ 9.0 is required. Get it from aka.ms/vcpython27` – shreeram shankar pattanayak Jul 06 '17 at 07:08
  • After the installation of VC++ 9.0 I am still facing the issue `error: command 'C:\\Users\\KNOT\\AppData\\Local\\Programs\\Common\\Microsof‌​t\\Visual C++ for Python\\9.0\\VC\\Bin\\amd64\\cl.exe' failed with exit status 2` – shreeram shankar pattanayak Jul 06 '17 at 07:10

2 Answers2

0

Can't you just copy the source and execute "pip install ." in the directory ?

Dedi
  • 35
  • 7
  • Yes I did that. Still no luck ! – shreeram shankar pattanayak Jul 05 '17 at 12:11
  • @Dedi--`03DEC550>: Failed to establish a new connection: [Errno 11004] getaddrinfo failed',)': /simple/pyasn/ Could not find a version that satisfies the requirement pyasn (from versions: ) No matching distribution found for pyasn` – shreeram shankar pattanayak Jul 06 '17 at 07:07
  • 1
    As you try to install your package, dependencies have to be installed. If it is not found, pip will try to install it from web. This is why error is raised. What you have to do if you want to install it offline mode is either having all the _.whl_ files (from dependencie to your package) or having all the sources : depedencies and final package. You can check the dependencies in the _setup.py_ file : `install_requires=['package_name>=version',...]` – Dedi Jul 06 '17 at 07:34
0

To answer the specific question "Can you install packages withou tthe internet" then asnwer is yes.

For example, armed with a wheel somewhere the machine can see, and pip

pip install some-dir/some-file.whl

or

python -m pip install some-dir/some-file.whl

There are other options than wheels, however, the same idea applies.

doctorlove
  • 18,872
  • 2
  • 46
  • 62