1

I have python project which i want to move another PC but that PC doesn't have internet connection. So, i cannot use the requirements.txt file solution given in ModuleNotFoundError: No module named 'string' while importing flask because this method requires installation of all site-packages from internet.

Is there any way to create a package locally on my current PC and then simply copy paste on another pc that doesn't have internet?

Piyush Jain
  • 23
  • 1
  • 4
  • Are you trying to deploy your project OR would you like to move the development to the other Computer? Which OS does the target Computer run on? – norok2 Feb 04 '19 at 16:05
  • I am trying to deploy my project. It will be on Windows 2012 server. The issue is that windows server doesn't have access to the internet as it is within customer strict environment with only internal network access. – Piyush Jain Feb 04 '19 at 16:09
  • For deployment, I would suggest you to look into PyInstaller or other solutions to "create a standalone executable from Python sources". – norok2 Feb 04 '19 at 16:10
  • Currently all the required libraries and packages are in \env\Lib\site-packages – Piyush Jain Feb 04 '19 at 16:11
  • 1
    thanks for your input. I will try pyInstaller and reply back if that works for me. – Piyush Jain Feb 04 '19 at 16:11
  • I am not sure you already read this thread or not. https://stackoverflow.com/questions/18951829/how-to-install-flask-offline Try this one. – Nazmul Hasan Sheum Feb 04 '19 at 16:21
  • You can make some nice single .exe programs installing PyInstaller and running `pyinstaller.exe --onefile "file_path"` in command prompt. – tgikal Feb 04 '19 at 17:47

1 Answers1

0

Haven't tried this myself but can't you

Create a virtualenv folder in the root folder of your project on your computer that has internet. -> make it install all the required packages there -> then copy your project to the pc without internet and -> start your projekt with the python version in your virtualenv folder

Mangocherry
  • 115
  • 5