Use python libraries of different versions - python-3.8

I'm using my app in python3.8. However I've to import a user-defined library which is built on python3.11.
Is it possible to have libraries from different versions?
I thought of using 2 python images in docker container but that solution didn't work

Related

I want to use different versions of Tensorflow in my project

My project requires Tensorflow 1.x and Tensorflow 2.x versions as this different versions do a specific task in the work flow. For deployment how do I add this to the workflow so I can programmatically select the instance to use the required version for the task. What’s the best solution

Best way to write setup script for multi-language project package that includes anaconda, atom, node.js etc.?

I am designing an environment for productive research, i.e. writing, data-analysis, publication, etc.
In order to share the final results with others, I need to find a way to package this and to set up the local installation.
The project depends on Anaconda, so conda as a package manager is available.
It also includes
Pandoc and some pandoc packages, some will have to be fetched from Github directly because some versions are not available via conda-forge (doable in conda)
Atom and Atom packages; they should be installed and configured by my script (this works on the CLI via the apm package manager)
Node.js and Mermaid and a few other JS packages, which require npm calls
Some file-system-level operations, like deleting parts from packages where I only need a portion from, creating symlinks and aliases etc.
Maybe some Python code for modifying yaml/json/ini files or reading therefrom.
The main project will reside in a Github repository. It will be fine for users to clone it from there and start a build script locally.
My idea is to write a Bash shell script that
creates a conda environment based on requirements.yaml for everything that can be done this way
installs other parts using CLI commands (wget/curl etc.)
does all necessary modifications using CLI commands, maybe using a few short Python scripts (e.g. for changing or reading JSON or yaml files).
My local usage will be on OSX Big Sur, Linux should be supported, Windows compatibility would be nice-to-have.
Before I start:
Is this approach viable? I think it will be pretty transparent, but of course also a bit proprietary.
Docker is likely overkill for my purpose, and I also read that the execution will be slow on OSX.
The same environment will likely be installed multiple times on the same users' machine, so it is important that I can control e.g. the usage of existing packages and files via aliases or symlinks. It is not important that the multiple installations are decoupled for the non-python/non-conda parts (e.g. atom, node.js, mermaid could be the same binaries for all installations; just the set of Python packages might vary by installation).
Thanks for your expertise!

How to distribute a desktop app built with Electron, Node.js and Python

I have recently built a desktop app using Electron and Express.js, and I also used python-shell in Node.js to call a python module. Specifically, the Express server will call the python module which sends SQL queries to Impala, and get the query result from it, then transmit it to the front-end.
It works well, but I wonder how to distribute this app? Obviously the python-shell module is not applicable without python environment. Any suggestions? Thank you all!
As far as I can see you have two possibilities:
Distribute a Python Installer along your Installation
Port your Python module to a native executable, native node module, or plain JS in the Electron app itself.

Using the mathutils module from blender in an independent project

I have a pluggin build for blender which i want to decouple from blender and run independently. The only dependency is the mathutils module. Is there a way to use the mathutils module from blender3d in an independent project.
There is a python package called mathutils, which can be found at https://gitlab.com/ideasman42/blender-mathutils It has all the modules except kdtree. To install simply run
sudo pip install mathutils
Note that it needs python 3 to run
The header files are written in C++ before being compiled into blender executable so I guess you could download the source files and have a look at it but you might not be able to isolate and recompile what you need in particular because of interdependencies and the way they mapped c++ classes into python objects.

How to develop and package with ActivePython?

I have been developing (a somewhat complicated) app on core python (2.6) and have also managed to use pyinstaller to create an executable for deployment in measurements, or distribution to my colleagues. I work on the Ubuntu OS.
What has troubled me is in upgrading the versions of numpy or scipy. Some features I need are in 0.9 and I'm still on 0.7. The process of upgrading them, or matplotlib, for that matter are not elegant. The way I've upgraded on my local machine was to delete the folders of these libraries, and then manually install the newer versions.
However, this does not work for machines where I do not have root access. While trying to find a workaround, I found ActivePython. I gave it a quick try and it seems to use PyPM to download the newest scipy and numpy to its custom install location. Excellent! I don't need root access and can use the latest version of the libraries.
QUESTION:
If there are libraries not available on the PyPM index with ActivePython, how can I directly use the source code of those libraries (example wxpython) to include into this installation?
How can I use pyinstaller to build an executable using only the libraries in the ActivePython installation?