-
Notifications
You must be signed in to change notification settings - Fork 155
Running from source
-
stable
is now targeted against Python 3.11, and will no longer work under Python 3.8 or earlier (Ref: TypeError when running from source on stable branch #1497) -
main
is now targeted against Python 3.11, and will no longer work under Python 3.8 or earlier (Ref: TypeError when running from source on stable branch #1497) -
develop
is targeted at Python 3.11 and has no guarantee about working on earlier Python versions. If you are not actively developing the application then you SHOULD NOT BE RUNNING THIS BRANCH.
In general you can check the contents of the file .python-version
in the
source for the version that code is targeting. This file is not included
in the Windows installers/packages as it's not necessary.
On Windows or macOS Download and install an appropriate version of CPython ('Core Python') from python.org.
You need a 32-bit version on Windows as this application has some code that calls OS APIs that needs changing for 64-bit and we've not yet had the incentive to resolve this.
On macOS you might run into issues with the HomeBrew python, to do with
a broken tk
. See #670 Update requirements.txt for MacOS
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, so long as
they provide at least 3.10.x. Note that you might need to specify python3
or
pip3
in any comments below, rather than python
or pip
.
We have moved to Python 3.11 and if you find that your Linux distribution is still only shipping Python 3.8 or earlier you will HAVE to install a later version separately and ensure you are using the correct version.
One tested method to get a later Python on Debian 11.x is to utilise pyenv.
-
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
-
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
-
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
-
Choose where the actual extra versions of Python will live, e.g. /usr/local/pyenv:
$ mkdir /usr/local/pyenv
-
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).
-
Use
pyenv
to install a new version of Python:pyenv install 3.11.1
-
Check that version is now available:
$ pyenv versions <possibly others> 3.11.1 <possibly others>
-
Activate that version and ensure shell is set up for it:
$ pyenv local 3.11.1 # 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.11.1
-
Ensure
pip
is installed and up to date for this version:$ python -m pip install pip $ python -m pip install --upgrade pip
-
-
If you want a 'venv' for just EDMarketConnector then you now:
This step is mandatory on Debian with Bookworm (12.x) or Later, or any system which enforces Externally-Managed Environments.
For information about Externally Managed Environments, see This Python Documentation Page or This PEP Document
$ 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 an alias added by 'activate' $ which python /usr/local/pyenv/shims/python # or whatever the python was before
Ensure you both have pip
installed, and that it is for Python 3.x by running:
pip --version
The output will have "(python X.Y)" on the end, indicating the version of Python it is for. If this says "2.7", or indeed anything other than "3.X" for some value of "X" then try:
pip3 --version
On Debian and derivaties you will need the following command in order to install this:
sudo apt install python3-pip
Otherwise see Installing pip.
Remember which of pip
or pip3
is the correct command for your system
when you get to Use pip
to install application requirements below.
python.org packages include this.
On Debian, Ubuntu, and other Debian derivatives the package you need to install
is python3-tk
:
sudo apt install python3-tk
On Arch you need:
sudo pacman -S tk
For other Linux distributions you will need to find the requisite package and how to install it. Keep in mind you need 'tkinter' for 'python3'. Installing 'tkinter' for Python 2.7 won't help you.
All other dependencies will be handled by pip
below.
Choose one of the following:
-
Using a zip of the latest stable source. Download and extract the latest stable source code.
NB: Some niche functionality will not work without two files from the FDevIDs repository, which are included in the Windows installer builds. You specifically need:
which should be placed in
FDevIDs/
that unzipping the release archive will have created.Without these the "Settings" > "Output" > "Market data in CSV format file" feature will not work.
-
OR Clone and checkout the source using git:
cd <directory you want to be the parent of the source>
git clone https://github.com/EDCD/EDMarketConnector.git
cd EDMarketConnector
git checkout stable
-
git submodule init
# Necessary to populateFDevIDs/
-
git submodule update --checkout
# Necessary to populateFDevIDs/
As per Contributing.md
stable
will contain the latest released code, or possibly some extra
commits leading up to the next release. If you're feeling slightly
braver you could use the main branch source code
(or git checkout main
) instead which might contain newer code that we
consider stable enough for the next release.
NB: Do not use the master
branch, it's almost empty! The name is
deprecated and we use main
instead.
-
Ensure additional necessary Python modules are installed with
pip install -r requirements.txt
- Note that on Debian (at least up to and including 10.x aka 'Buster')
you'll need
pip3 install -r requirements.txt
- If you get 'command not found' or similar for the 'pip' command then
try:
python -m pip --user install pip
The main application doesn't work without access to Journal files. It can't even determine your Commander name without them. So, if you're running this application on a machine separate from where you play the Game you will need to set up a network share of those files.
You'll always find them on Windows at:
shell:SavedGames\Frontier Developments\Elite Dangerous\
so share that folder. Then get that mounted on the remote machine.
Then you will need to set the correct location on the remote machine in the
application's Settings
> Configuration
> E:D journal file location
option.
The application logfiles
are written under $TMPDIR
if that is set, else
whatever the default is for your OS, e.g. /tmp
on Linux.
If you only ever run this application as one user then the default isn't a problem. However, if you do run it as more than one user then the subsequent user(s) won't have permission to write to the log files/directories.
The best workaround for this is to ensure you explicitly set TMPDIR
to a
per-user location, e.g. in ~/.bashrc
:
export TMPDIR="${HOME}/tmp"
mkdir -p "${TMPDIR}"
- Linux:
python3 EDMarketConnector.py
- Mac:
python3 EDMarketConnector.py
- Windows:
EDMarketConnector.py
#Command-line
The command-line program EDMC.py
writes the current system and station (if
docked) to stdout and optionally writes player status, ship locations, ship
loadout and/or station data to file.
This program requires that the user has performed Frontier Authentication through the main application.
Arguments:
-h, --help show this help message and exit
-v, --version print program version and exit
-a FILE write ship loadout to FILE in Companion API json format
-e FILE write ship loadout to FILE in E:D Shipyard plain text format
-l FILE write ship locations to FILE in CSV format
-m FILE write station commodity market data to FILE in CSV format
-o FILE write station outfitting data to FILE in CSV format
-s FILE write station shipyard data to FILE in CSV format
-t FILE write player status to FILE in CSV format
-d FILE write raw JSON data to FILE
-n send data to EDDN
-p CMDR Returns data from the specified player account
The program returns one of the following exit codes. Further information may be written to stderr.
- Success. Note that this doesn't necessarily mean that any requested output files have been produced - for example if the current station doesn't support the facilities for which data was requested.
- Server is down.
- Invalid Credentials.
- Verification Required.
- Server is lagging.
- I/O or other OS error.