M
Modular15mo ago
Kushagra

Mojo Versioning System

How is MOJO planning to handle version system or so? The way python does it right now is very messy, you get multiple versions of python installed on the same machine, and then sometimes when you install packages using pip, they go in site-packages of old versions and are not available for newer versions when trying to use them etc. Some information on this would be really helpful
8 Replies
Chris Lattner
Chris Lattner15mo ago
We don't have specific plans around this - mojo is still very early and evolving fast, so the best thing is to "always be upgrading" for awhile. As it settles out, we can choose to provide a stable ABI so things end up working more like the C/C++ ecosystem, which doesn't have any of these problems.
Kushagra
KushagraOP15mo ago
Umm, okay, However, I have a request if possible, Not right now, but later around the first stable releases or so, Can we have a way to choose what version of the language will be used to compile or execute the code? Like a shebang or something?
#! v1.0.0+
#! v1.0.0+
In the code itself
Melody Daniel
Melody Daniel15mo ago
I have not found it messy with Python because I mostly work in a virtual environment, package installs do not conflict. Short version? I don't see anything wrong with how it's done in Python, not that it's Python's fault anyway
Kushagra
KushagraOP15mo ago
I installed multiple versions of python in my system and I don't use virtual environments for most cases, as I install packages and use it in multiple different folders and places It feels very very messy to me only because, at times the error is undetectable for many people specially the new ones It just shows no module named xyz And when you do pip install xyz, it says already installed or successfully installed
Melody Daniel
Melody Daniel15mo ago
That is interesting, it should normally just use the default Python for installations if you don't specify a version (or whatever version is set as python3 symlink in the usr/bin directory). To work with multiple Python versions without creating a virtual environment you can use specific versions. i.e python3.9 -m pip install <package>
Kushagra
KushagraOP15mo ago
Umm okay that is interesting, never knew that I could install a package for the specific version This solves my problems Thanks a lot
guidorice
guidorice15mo ago
Interesting to think that a stable ABI will eliminate some package versioning issues! Not sure I understand how that works in practice, but looking forward to learning. @Kushagra also good to be aware that virtualenvs are actually built into python now- you don't even need any special dev tools to use it:
$ python3 -m venv venv # creates new venv in current dir
$ source venv/bin/activate
$ which python
/Users/guidorice/venv/bin/python
$ which pip
/Users/guidorice/venv/bin/pip
$ pip list
Package Version
---------- -------
pip 23.2.1
setuptools 68.1.2
$ python3 -m venv venv # creates new venv in current dir
$ source venv/bin/activate
$ which python
/Users/guidorice/venv/bin/python
$ which pip
/Users/guidorice/venv/bin/pip
$ pip list
Package Version
---------- -------
pip 23.2.1
setuptools 68.1.2
Now the commands python or pip will use the one inside the current venv.
gabrieldemarmiesse
rust is often praised for its packaging story, maybe there are some ideas we could take from there?
Want results from more Discord servers?
Add your server