0

I created a python script by pycharm (I used several libraries). I want to use this script on a Linux server. How to do it? I tried with the PyInstaller but it generates .exe

P.S Linux server is without Internet and PIP.

Thank you very much in advance

EDIT I read that is imposible and I should use WINE

3
  • PyInstaller should create a working binary. How are you executing it? Commented Feb 7, 2018 at 13:50
  • Could you explain why your Linux server is unable to access the internet? Will you only ever be able to access it physically (ie. not over a network)? Commented Feb 7, 2018 at 13:51
  • pyinstaller name.py or pyinstaller --onefile name.py and try wit pyinstaller -D -F -n name -c "nam.py" Yep, I have access by ssh (root). It is internal server. Commented Feb 7, 2018 at 13:58

1 Answer 1

1

It's unusual (but not unheard of) for your Linux server to be without an internet connection. (If you're doing secure batch processing, however, this might make sense.) Installing all of your script's dependant packages onto the server will be a bit tougher without internet access.

You'll need to find a packaged Python release, either in .rpm or .deb format (depending on your Linux distribution). Alternatively, you can compile it from source by downloading a package from the Python website and following the included compilation instructions.

You'll then probably need to get pip to install all of your Python dependencies into an isolated directory on a server which has an internet connection, as per this answer.

As for how you get these files onto the server, that will depend on your specific circumstances. If it's connected to an intranet, you could eg. use scp to get them from another Linux machine over ssh, or if you have physical access to the machine, a USB stick might do the trick. However, given that you've managed to get 'pyinstaller' onto the machine, you may already have this sussed.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.