Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am a newbie to Web2py and Python and I am trying to add requests
(http://docs.python-requests.org) however I am unsure how to add
this to my current Web2py environment.
I am running OSX with Web2Py 2.12.3
If you are running the Mac binary version of web2py, it includes its own Python interpreter (so if you have Python installed on your system, it will ignore any libraries available in your system Python installation). To make requests available to your web2py app, you can either put the requests package in the app's /modules folder, or you can put it in the web2py /site-packages folder, which on the Mac is inside /Contents/Resources.
However, a better option is probably just to install Python on your machine and then use the source version of web2py instead of the Mac binary. Then you can use pip to install any external libraries and they will be available when running web2py.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 1 year ago.
Improve this question
Some programming languages provide capability t create a self contained packages that can run on any machine.
For example, dotnet core can self-contained apps per below:
https://learn.microsoft.com/en-us/dotnet/core/deploying/#publish-self-contained
The C# self-contained apps can be single large file, or a directory of all files required to run the application. The package can target Linux, mac or Windows.
In Python, what is the closest feature to self-contained app packages described above?
PyInstaller seems to be the current go to, and it works well in my experience. However, some people have reported that it has very large file sizes, but I've personally never found that to be a major issue.
If you use that, you would also probably need some kind of UI, but that's a separate issue in itself.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 3 years ago.
Improve this question
I want to install conda python packages on all cluster machines
Check out conda-pack:
conda-pack can be used to distribute conda environments to be used with Apache Spark jobs when deploying on Apache YARN. By bundling your environment for use with Spark, you can make use of all the libraries provided by conda, and ensure that they’re consistently provided on every node. This makes use of YARN’s resource localization by distributing environments as archives, which are then automatically unarchived on every node. In this case either the tar.gz or zip formats must be used.
Source: https://conda.github.io/conda-pack/spark.html
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I want to understand the difference between distributing a python application. The application should be used on both Windows and Mac OS platforms. I see there are two ways of doing it.
Either create a executable using py2exe / py2app etc
Distribute the application using pip.
I would like to understand the use-cases for both the solutions.
A few things. As Sam Chats mentioned, one possible use case for creating the executable is if you don't want to share your source code, while if you distribute the application using pip, you will be able to. Additionally, if you distribute using pip vs. creating an application, more users may be able to easily access your application. As an example, check out this StackOverflow answer as a reason for using pip over Anaconda
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I'm using Blender and Python and want to give the .py file to other users to use my script... My script uses external modules (like NumPy) which will rise the errors (like can't find module xxxx).
Not all people can install NumPy (or even Python :D) as many Blender users are just artists.
Another note is that NumPy doesn't work with Blender (I install it in the system's Python, then delete Blender Python so it relies on the system Python).
If you want to distribute your code with external dependencies then you should build a Python egg. The .egg format was created to solve the issue you are dealing with. It is a self-contained release of your code with dependencies and meta-data. Here is some information on how create Python eggs.
Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 8 years ago.
Improve this question
I have a site, built on Django/Python, which I need to profile. It's running on Ubuntu server with Apache, and I want to launch it on my local computer, under Windows on Django-dev-server.
The problem is that the site requires specific (outdated) versions of libraries, otherwise I will need to do many time wasting things to get it running (like migrations, dealing with changes of API in modules, etc).
So I basically need to build a version of Python interpreter on Windows, which will correspond to the version running on the Linux server - with all version of modules matching.
If there are no solutions for Windows, Linux also would be OK.
Kindly help!
Why not just run Linux as a VM in VirtualBox? If there is a requirements.txt file, it shouldn't be difficult to get running using pip to install modules, unless the versions of those modules aren't available anymore.
If the project is so old that the necessary modules aren't available, you're probably better off writing new code with updated modules.
You can create the test lab as follows.
The version of libraries and OS in virtual machine on windows or linux.
For the version of python you can use a virtual environment.
The easiest way to configure a custom Python environment is to setup a
"virtual environment" for Python using virtualenv. Virtualenv allows
you to add and modify Python modules without access to the global
installation.
wget http://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.5.2.tar.gz
tar xzf virtualenv-1.5.2.tar.gz
python virtualenv-1.5.2/virtualenv.py $HOME/env
or
python virtualenv-1.5.2/virtualenv.py --no-site-packages --distribute $HOME/env