Add library/module to server - python

I am pretty new to python and would like to use the PyMuPDF library on a web server in order to modify PDFs. The problem is, I am unable to add/install any modules or libraries to/on the server.
Is there a way to install all libraries and modules in a directory, then upload this directory to the server and link the python file (also on server) to these uploaded folders?

Related

How can I work on a python project hosted on a remote server using Pycharm?

I have a server I connect to using SFTP, and I've followed these steps to edit individual files hosted on the server.
But I have an entire python project structure on the server, and I'd like PyCharm's suggestions/auto-complete to be aware of the other files/directories in said project.
Is there anyway to achieve this using PyCharm? I feel like file mappings are the answer, but I don't see any way to download a remote directory onto a local drive and then setup a synchronization.
Also there are some resources I don't want to download onto my local environment, so if there was a way to do this remote only, so much the better.

Transform a python file, that uses packages like pandas, to be usable by someone that has no python environment

I have a client for whom I have created a program that utilizes a variety of data and machine learning packages. The client would like for the program to be easily run without installing any type of python environment. Is this possible?
I am assuming the best bet would be to transform the .py file into a .exe file but am unsure of how to do this if I have packages that need to be installed before the program can be run.
Are there websites that exist that allow you to easily host complex .py files on them to be run by anyone that accesses the URL?
I think you are looking for "freezing", which package everything including the interpreter, libs and packages into a single executable file.
There are several tools for this purpose:
https://wiki.python.org/moin/Freeze
https://docs.python-guide.org/shipping/freezing/
I think the use of colaboratory that is cloud service provided by Google might be better. Your client who has to sign up for Google account can not only run the python program, but also utilize any major python packages on the cloud (of course, it's possible to install the necessary packages into the client's cloud space), without constructing the python environment on client's local PC. What's more, it's at free!

How to save third-party libraries, transport them and launch an application with them Python

Basically, the title is the question.
I'm looking for a possibility to save third-party libraries in the application folder and run this application with these libraries on another PC (internet on PC is not available.) Don't want to run this application as a zip archive with one entry point, just as a basic python app based on this locally installed third-party libraries.
Any advice on tools?

How to get local users username from Web2Py?

I am working on a web2py app which I would like to be able to use some of the user's local variables to customize things a bit, specifically I am trying to get the user's domain and username.. I know that this is possible running on an Apache using the module "mod_auth_sspi".
Is this possible on a Rocket WSGI 1.2.6 server? Or has anybody tried doing this on a web2py app before? Is there a python module that could do this?
I just ended up moving the web2py app over to an Apache server. If somebody doesn't know how to do this then you can find all of the documentation here:
http://web2py.com/book/default/chapter/13
After that I installed the mod_auth_sspi module in order to get instructions. The x86 version of the module can be downloaded from here:
http://goo.gl/syzjuk
It will require an x86 installation of Apache though. After it is downloaded:
Unzip the file
Drag mod_auth_sspi.so from the bin folder into wherever you modules folder
for your Apache installation is.
Add LoadModule sspi_auth_module modules/mod_auth_sspi.so to your httpd.conf file as
well as any sspi settings you need to whichever location you need to apply security to.
I did have some issues with authentication on some browsers, but I did find solutions which you can find here:
How can you store a log in using mod_auth_sspi on Apache?

Distributing a stand-alone Python web-based application to non-technical users

I'm writing a web application in Python, intended for use by teachers and pupils in a classroom. It'll run from a hosted website, but I also want people to be able to download a self-contained application they can install locally if they want more performance or they simply won't have an Internet connection available in the classroom.
The users aren't going to be able to manage instructions like "first install Python, then install dependencies, download the .tar.gz archive and type these commands into the command line...". I need to be able to create an all-in-one type installer that can potentially install Python, dependencies (Python-LDAP), some Python code, and register a Python-based web server as a Windows Service.
I've had a look through previous questions, but none quite seem relevant. I'm not concerned about the security of source code (my application will be open source, I'll sell content to go with it), I just need non-technical Windows users to be able to download and use my application with no fuss.
My current thoughts are to use NSIS to create an installer that includes Python and Python-LDAP as MSIs, then registers my own simple Python-based web server as a Windows service and puts a shortcut in the start menu / on the desktop linking to http://localhost. Is this doable with NSIS - can NSIS check for currently installed copies of Python, for instance? Is there a better way of doing this - is there a handy framework available that lets me shove my code in a folder and bundle it up to make an installer?
Using NSIS is great (i use it too) but i would suggest using a "packager" like pyinstaller (my personal fav, alternatives bb_freeze, py2exe) to create an exe before the using NSIS
The primary benefit you get by doing this is;
Your download is smaller as you're not bundling the whole Python Standard Lib and extra stuff your app wont need and you get an exe file to boot!
You can try the Bitnami Stack for Django that includes Apache, MySQL,Python, etc in an all-in-one installer. It is free/open source

Categories