mirror of
https://github.com/EDCD/EDMarketConnector.git
synced 2025-04-20 10:57:37 +03:00
General update for appropriate Python versions & misc
* Section added about using pyenv to get non-distribution versions of Python working on Debian.
parent
97e14d5392
commit
b6404e38d5
11
Plugins.md
11
Plugins.md
@ -17,7 +17,7 @@ plugins 'EDDN', 'EDSM' and 'Inara') should be reported to the author of
|
||||
that plugin, **not as an issue on the main EDMC project**.
|
||||
|
||||
|
||||
Available plugins - Confirmed working under Python 3.7
|
||||
Available plugins - Confirmed working under Python 3.7+
|
||||
--------
|
||||
* [ATEL-EDMC](https://github.com/Elite-IGAU/ATEL-EDMC/releases) - Automatically collects "Codex" discovery data, and (optionally) posts public Astronomical Discovery "Telegram" style notices. **NB: Ensure you're using a Python 3.7 compatible version, [1.32 or later](https://github.com/Elite-IGAU/ATEL-EDMC/releases/tag/1.32).**
|
||||
* [DistanceCalc](https://github.com/Thurion/DistanceCalc) - Displays the distance to up to 3 systems.
|
||||
@ -49,7 +49,7 @@ Available plugins - Confirmed NOT working under Python 3.7
|
||||
* [edstats](https://github.com/strideynet/edstats-edmc-plugin/wiki) - A plugin that transmits data to [EDStats](https://edstats.isadankme.me/). [Issue](https://github.com/strideynet/edstats-edmc-plugin/issues/3)
|
||||
|
||||
|
||||
Available plugins - Unknown Python 3.7 status
|
||||
Available plugins - Unknown Python 3.7+ status
|
||||
--------
|
||||
<none> ?
|
||||
|
||||
@ -63,6 +63,11 @@ The `plugins` folder is located at:
|
||||
|
||||
If you would like to write a plugin
|
||||
---
|
||||
EDMC is migrating from Python 2.7 to Python 3.7. Currently the updated documentation for writing a plugin under Python 3.7 is at [PLUGINS.md](https://github.com/EDCD/EDMarketConnector/blob/main/PLUGINS.md).
|
||||
EDMC has migrated from Python 2.7 to Python 3.7 and onwards to 3.9. Currently
|
||||
the updated documentation for writing a plugin under Python 3.9 is at [PLUGINS.md](https://github.com/EDCD/EDMarketConnector/blob/main/PLUGINS.md).
|
||||
|
||||
**We strongly advise against** making any plugin code compatible with
|
||||
Python 2.7, so as to encourage users to actually update their EDMC install
|
||||
to the latest release.
|
||||
|
||||
EDMC 3.46 is the final version using Python 2.7. The older documentation is still available at [PLUGINS.md](https://github.com/EDCD/EDMarketConnector/blob/rel-346/PLUGINS.md) .
|
||||
|
@ -1,7 +1,13 @@
|
||||
# Running from source
|
||||
|
||||
You will currently need at least Python 3.7.x to run `stable` code. In order to run
|
||||
`develop` you will need Python 3.8.x or higher (3.9.x has had some testing).
|
||||
* `stable` branch, up to version 4.2.4, uses Python 3.7.x, although it
|
||||
should work perfectly well with any 3.8 or 3.9 version as well.
|
||||
|
||||
* `main` is now targeted against Python 3.9, although should also work
|
||||
under 3.8.
|
||||
|
||||
* `develop` is targeted at Python 3.9 and has no guarantee about working on
|
||||
earlier Python versions.
|
||||
|
||||
## Ensure Python is installed
|
||||
|
||||
@ -9,7 +15,9 @@ On Windows or macOS Download and install an appropriate version from
|
||||
[python.org](https://python.org). Do **not use HomeBrew** on macOS, that
|
||||
version is known to have a broken `tk`. See [#670 Update requirements.txt for
|
||||
MacOS](https://github.com/EDCD/EDMarketConnector/issues/670)
|
||||
for discussion about this.
|
||||
for discussion about this. That might be fixed now, but if you're having
|
||||
issues with a HomeBrew version of Python the first thing we'll ask you to
|
||||
do is try again with the python.org version.
|
||||
|
||||
|
||||
On Linux you should use your distribution's Python 3.x packages. Note that at
|
||||
@ -17,11 +25,89 @@ least Debian 10 still has 2.7.x as `python` and `pip`, and you will need to
|
||||
specify `python3` (from the package of that name) and `pip3` (from
|
||||
`python3-pip` in the commands below in order to use a 3.x version.
|
||||
|
||||
As and when we move from Python 3.7 to 3.8 or beyond you might find that
|
||||
As and when we move from Python 3.7 to 3.9 or beyond you might find that
|
||||
your Linux distribution is still only shipping Python 3.7, in which case
|
||||
you will need to install a later version separately and ensure you are
|
||||
using the correct version. You already need at least Python 3.8.x to use our
|
||||
`develop` branch code.
|
||||
using the correct version.
|
||||
|
||||
### Using a non-distribution Python on, e.g. Debian
|
||||
|
||||
One tested method to get a later Python on Debian 10.x is to utilise
|
||||
[pyenv](https://github.com/pyenv/pyenv-installer/).
|
||||
|
||||
1. You will need some pre-requisites:
|
||||
|
||||
apt install -y make build-essential libssl-dev zlib1g-dev libbz2-dev \
|
||||
libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev \
|
||||
libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev
|
||||
|
||||
1. Choose where you want `pyenv-installer` to live, e.g. /usr/local/src:
|
||||
|
||||
$ mkdir -p /usr/local/src
|
||||
$ cd /usr/local/src
|
||||
$ curl -L https://raw.githubusercontent.com/pyenv/pyenv-installer/master/bin/pyenv-installer -o pyenv-installer
|
||||
|
||||
1. Choose where you want `pyenv` itself to live, make the directory, and
|
||||
then run pyenv-installer with PYENV_ROOT pointing there, e.g.:
|
||||
|
||||
$ mkdir -p /usr/local/src/pyenv
|
||||
$ PYENV_ROOT=/usr/local/src/pyenv ./pyenv-installer
|
||||
|
||||
1. Choose where the actual extra versions of Python will live, e.g.
|
||||
/usr/local/pyenv:
|
||||
|
||||
$ mkdir /usr/local/pyenv
|
||||
|
||||
1. Add pyenv to your shell startup, e.g. `~/.bashrc`:
|
||||
|
||||
export PATH="/usr/local/src/pyenv/bin:$PATH"
|
||||
export PYENV_ROOT=/usr/local/pyenv
|
||||
eval "$(pyenv init -)"
|
||||
eval "$(pyenv virtualenv-init -)"
|
||||
|
||||
You will either need to start a new shell now, or issue the commands
|
||||
above in the current one (as well as adding them to shell startup).
|
||||
|
||||
1. Use `pyenv` to install a new version of Python:
|
||||
|
||||
pyenv install 3.9.2
|
||||
|
||||
1. Check that version is now available:
|
||||
|
||||
$ pyenv versions
|
||||
<possibly others>
|
||||
3.9.2
|
||||
<possibly others>
|
||||
|
||||
1. Activate that version and ensure shell is set up for it:
|
||||
|
||||
$ pyenv local 3.9.2 # You could use 'global' as well here
|
||||
$ eval "$(pyenv init -)" # Sets it in PATH
|
||||
$ which python
|
||||
/usr/local/pyenv/shims/python
|
||||
$ python --version
|
||||
Python 3.9.2
|
||||
|
||||
1. Ensure `pip` is installed and up to date for this version:
|
||||
|
||||
$ python -m pip install pip
|
||||
$ python -m pip install --upgrade pip
|
||||
|
||||
1. If you want a 'venv' for just EDMarketConnector then you now:
|
||||
|
||||
$ cd <where you have the source>
|
||||
$ python -m venv venv
|
||||
$ source venv/bin/activate
|
||||
$ which python
|
||||
<path to source>/venv/bin/python
|
||||
|
||||
Now you will need to remember `source venv/bin/python` before running
|
||||
`./EDMarketConnector.py`. If you want to go back to using the prior
|
||||
version of Python then just issue the command:
|
||||
|
||||
$ deactivate # This is a added by 'activate'
|
||||
$ which python
|
||||
/usr/local/pyenv/shims/python # or whatever the python was before
|
||||
|
||||
## Ensure you have working `pip`
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user