Python: Installing virtual environment on network drive - python

I wrote a Python program that I use daily at work, and I was hoping to be able to pass it along to others who have zero programming experience.
I need to avoid having each user download Python and the relevant dependencies, and I also can't compile it into an executable.
I tried creating a virtualenv on a network drive, and made a .bat file that activates it and runs the script in the environment. It works for me, but other users get a "Can't find python34.dll" error when they try to run it.
Is there anyway around this? Am I going about this incorrectly? The goal is to have non-Python users be able to run the script without installing Python or compiling it all into a .exe.

Related

How to use python console of pycharm with a poetry environment?

Context : I am trying to find the best environment to develop analytics ml project in python where I can both write my main pipeline functions as a script (and access variable through a console) and then do analytic on notebooks.
Each project is different and so I am defining new poetry env to settle the right python packages. At each step when running my script I need to be able to access the variables easily to debug and code faster. I am currently using pycharm as IDE, but I can't find a way to activate and use my poetry env when running a python file through the python console of pycharm. I can only choose the python version, but the packages used when running the python console seem to be the one installed globally on my computer. Being able to access variables through python console while still using poetry env would help me save a lot of time when developing my script.
If it's not possible to run python console on pycharm with poetry env, I might change IDE to go to VS Code, as some friends advice me to do. If you have any advice, I will take them gladly :) !
Thank you very much and have a nice day !

Shipping Interpreter with Python application

I am new to Python. Please excuse me if my question seems stupid. I have spent a lot of time before posting this.
When I searched for shipping python interpreter with the applications, I found solutions including installing separate applications, using third party modules, etc...
I was thinking of more direct approach: I first install python interpreter on my machine (windows). Then I ship the installed python interpreter (copy and paste the folder) with the pyc file of my application. And finally I create a simple batch program that executes the interpreter and running the pyc file. In this case, the user can simply run the application by simply running the batch program. I have tried it and it worked.
Although this solution seems the most obvious and the easiest one, I am in a doubt about it because I cannot find any one mentioning it. Is there anything wrong with my solution? I usually create desktop applications for windows.
Thanks in advance.
Make a virtual environment for you application and then run run the command python filename.py --onefile --windowed while still being in the virtual env. activated,

How can I run a python script without python.exe

My goal is to have a python script that I can giving to someone to run on their windows machine that does not have python installed. I do want to package it up in an exe because I want the underlying code to be easily read.
I am updating an old VBscript and I want to mirror it. I am also using a few libraries.
use pyinstaller to package it up to an exe. You can still maintain your source code. Packaging it up wont remove your source code.

Creating a "pen drive program" with Python

I'm bringing you this issue: I'm trying to create a program to run in Windows using PyQT, to work on a pen drive. My idea is: I plug my pen drive, and everything that I need to run the program is there, including Python 3, PyQT, etc.. I don't want the user to install all the requirements, I just want one executable that install all the programs necessary and then, there will be the executable to open the program. Considering, of course, that Python 3 is not installed in this Windows Machine
Just wondering how can I do it? Do you guys have any idea?
Thanks,
Gus.
Just an idea - not sure if that would work under your specific conditions (PyQT etc), but couldn't you run it from the pen drive directly? As in create a Python virtual environment (for example using venv, with all the dependencies) on the pendrive and then call your program using the python interpreter in the installed virtual environment.
Or use the virtual environment and it's interpreter to install the dependencies?

Python: "No virtualenv active"

I installed PyCharm 2.7 under Windows 8.1. It works fine, but every time I run a program, I get the following warning:
WARNING:root:No virtualenv active
Why does it happen and how can I fix it?
Program you run needs a virtual environment to run. This is a nice python feature that allows you to isolate a python program within the scope of the specific python set of libraries it may need. If you do not run more than one Python program you may not be really worried about it. However, it you do, I would recommend to ready about virtualenv first.
ps. Also, it might be just a debug log for developers to make sure they switched virtual env.

Categories

Resources