Installing pyfa on ubuntu 18.04


(Anderson Geten) #1

I struggled to install pyfa, so once I succeeded I wrote all I had to do in order for pyfa to be functional on my ubuntu station.

pyfa is installed per user, and available in bash. If you want to create a real program to open files with, this is not my concern. If you don’t use ubuntu, not in the scope.

Install

run those commands in bash to install pyfa. You may have issue with pip3 , see below. The lines starting with # are comments, run them or not won’t have any impact.

#install ubuntu dependencies and pip3
sudo apt install python3-pip python-wxgtk4.0 python3-wxgtk-webview4.0

# install pip dependencies for pyfa
pip3 install --user cryptography logbook markdown2 matplotlib packaging pip python-dateutil roman sqlalchemy

# create a directory for pyfa and clone the git project inside
mkdir -p "$HOME/bin"
git clone https://github.com/pyfa-org/Pyfa.git "$HOME/bin/pyfa"

# add the pyfa command to your bash aliases
echo $'\n'"alias pyfa=\"python3 $HOME/bin/pyfa/pyfa.py\"" >> $HOME/.bash_aliases
echo $'\n'"alias pyfaup=\"cd \\\"$HOME/bin/pyfa\\\" && git pull\"" >> $HOME/.bash_aliases
source "$HOME/.bashrc"

Run PYFA and update it

Just type in bash pyfa to start it.

To update, run pyfaup

pip3 error

if error with “can’t import main”

sudo gedit /usr/bin/pip3

l9 replace “from pip import main” by “from pip._internal import main”


Tell me if more errors (likely missing apt install or pip3 install).

edit : need pip3 matplotlib for graphs
edit : /usr/bin/pip3
edit : python-dateutil from pip, not dateutil . also corrected apt install ligtk3
edi : added packaging , pip as pip install ; moved wxwidget as apt install (easier)


Pyfa - The Python Fitting Assistant - v2.3.0 (Mutaplasmids!)
(player 1 ready) #2

sudo gedit /usr/bin/pip3 ?


(Anderson Geten) #3

corrected, thx


(Gisele Serebriakova) #4

I get,

Building dependency tree       
Reading state information... Done
E: Unable to locate package libgtk3
pyfainstall.txt: line 2: pip3: command not found
pyfainstall.txt: line 4: git: command not found

This is me missing pip3 install?


(Whitehound) #5

Yes. See what he wrote above:

It means you’ll have to install some packages first. So you’ll need a package called python3-pip and python3-git I’m assuming. Although he hasn’t listed the later. Could be you only need git itself and not the Python module on top of it. And since it says E: Unable to locate package libgtk3 did you also not install libgtk3 or libgtk-3.0 (depending on your distro can the exact names vary a little).


(Gisele Serebriakova) #6

Now I get,

Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libgtk3

and

bash pyfainstall.txt
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libgtk3
Collecting cryptography
  Using cached https://files.pythonhosted.org/packages/59/32/92cade62c645756a83598edf56289e9b19aae5370642a7ce690cd06bc72f/cryptography-2.3.1-cp34-abi3-manylinux1_x86_64.whl
Collecting dateutil
  Could not find a version that satisfies the requirement dateutil (from versions: )
No matching distribution found for dateutil
Cloning into '/home/daniel/bin/pyfa'...
remote: Counting objects: 49740, done.
remote: Compressing objects: 100% (117/117), done.
remote: Total 49740 (delta 98), reused 81 (delta 39), pack-reused 49584
Receiving objects: 100% (49740/49740), 407.59 MiB | 3.10 MiB/s, done.
Resolving deltas: 100% (33994/33994), done.
``

(Shochu Kampai) #7

Try:

sudo apt install libgtk3.0


(Gisele Serebriakova) #8

The install thinks I have the file

daniel@uH2:~/Desktop$ sudo apt install libgtk3.0
Reading package lists... Done
Building dependency tree       
Reading state information... Done
Note, selecting 'libgtk3.0-cil-dev' for regex 'libgtk3.0'
Note, selecting 'libgtk3.0-cil' for regex 'libgtk3.0'
libgtk3.0-cil is already the newest version (2.99.3-2).
libgtk3.0-cil-dev is already the newest version (2.99.3-2).
The following packages were automatically installed and are no longer required:
  fonts-wine libllvm6.0 libllvm6.0:i386 libnvidia-common-396 libpoppler-qt5-1
  libqt5designercomponents5 libwine libwine:i386 libwine-development
  libwine-development:i386 ocl-icd-libopencl1:i386 qt5-assistant
  qttools5-dev-tools wine-stable wine-stable-amd64 wine-stable-i386:i386
  wine32:i386 wine32-development:i386 wine64 wine64-development
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 12 not upgraded.

No change in the scripts output

daniel@uH2:~/Desktop$ bash pyfainstall.txt
[sudo] password for daniel: 
Reading package lists... Done
Building dependency tree       
Reading state information... Done
E: Unable to locate package libgtk3
Collecting cryptography
  Using cached https://files.pythonhosted.org/packages/59/32/92cade62c645756a83598edf56289e9b19aae5370642a7ce690cd06bc72f/cryptography-2.3.1-cp34-abi3-manylinux1_x86_64.whl
Collecting dateutil
  Could not find a version that satisfies the requirement dateutil (from versions: )
No matching distribution found for dateutil
Cloning into '/home/daniel/bin/pyfa'...
remote: Counting objects: 51322, done.
remote: Compressing objects: 100% (1688/1688), done.
remote: Total 51322 (delta 108), reused 1660 (delta 50), pack-reused 49584
Receiving objects: 100% (51322/51322), 412.60 MiB | 16.27 MiB/s, done.
Resolving deltas: 100% (34004/34004), done.


(Anderson Geten) #9

you are missing the dateutil.

this is mandatory and brings the dateutil packages to python.


because python3-git is not mandatory.


(Gisele Serebriakova) #10
daniel@uH2:~$ pip3 install --user cryptography dateutil
Collecting cryptography
  Using cached https://files.pythonhosted.org/packages/59/32/92cade62c645756a83598edf56289e9b19aae5370642a7ce690cd06bc72f/cryptography-2.3.1-cp34-abi3-manylinux1_x86_64.whl
Collecting dateutil
  Could not find a version that satisfies the requirement dateutil (from versions: )
No matching distribution found for dateutil
daniel@uH2:~$ cd /home/daniel/Desktop

No change in the scripts output. That should be expected though.

I tried to install dateutil by other means:

daniel@uH2:~/Desktop$ apt-cache search python3-dateutil
'python3-dateutil - powerful extensions to the standard Python 3 datetime module
daniel@uH2:~/Desktop$ sudo apt-get install python3-dateutil
Reading package lists... Done
Building dependency tree       
Reading state information... Done
python3-dateutil is already the newest version (2.6.1-1).
The following packages were automatically installed and are no longer required:
  fonts-wine icedtea-netx-common junit junit4 libcommons-collections3-java
  libcommons-math-java libfreehep-export-java libfreehep-graphics2d-java
  libfreehep-graphicsio-emf-java libfreehep-graphicsio-java
  libfreehep-graphicsio-pdf-java libfreehep-graphicsio-svg-java
  libfreehep-graphicsio-tests-java libfreehep-io-java libfreehep-swing-java
  libfreehep-util-java libfreehep-xml-java libhamcrest-java libjas-java
  libjas-plotter-java libjaxen-java libjcommon-java libjdom1-java
  libjfreechart-java libjfugue-java libjlatexmath-java libllvm6.0
  libllvm6.0:i386 liblog4j1.2-java libnb-org-openide-util-java
  libnb-org-openide-util-lookup-java libnvidia-common-396 libpoppler-qt5-1
  libqt5designercomponents5 librhino-java libtablelayout-java libwine
  libwine:i386 libwine-development libwine-development:i386 libxerces2-java
  libxml-commons-external-java libxml-commons-resolver1.1-java libxom-java
  mathpiper ocl-icd-libopencl1:i386 qt5-assistant qttools5-dev-tools
  wine-stable wine-stable-amd64 wine-stable-i386:i386 wine32:i386
  wine32-development:i386 wine64 wine64-development
Use 'sudo apt autoremove' to remove them.
0 upgraded, 0 newly installed, 0 to remove and 22 not upgraded.
daniel@uH2:~/Desktop$ pip install python-dateutil
Collecting python-dateutil
  Downloading https://files.pythonhosted.org/packages/cf/f5/af2b09c957ace60dcfac112b669c45c8c97e32f94aa8b56da4c6d1682825/python_dateutil-2.7.3-py2.py3-none-any.whl (211kB)
    100% |████████████████████████████████| 215kB 4.3MB/s 
Collecting six>=1.5 (from python-dateutil)
  Using cached https://files.pythonhosted.org/packages/67/4b/141a581104b1f6397bfa78ac9d43d8ad29a7ca43ea90a2d863fe3056e86a/six-1.11.0-py2.py3-none-any.whl
Installing collected packages: six, python-dateutil
Successfully installed python-dateutil-2.7.3 six-1.11.0

Looks like it’s already installed.


(MorsMortis Shiyurida) #11

When running pyfa after following the instructions I receive the below error.

pyfa v2.4.0 (git)
EVE Data Version: 1369747 (2018-08-21 20:33:06)

OS version: Linux-4.15.0-34-generic-x86_64-with-Ubuntu-18.04-bionic
Python version: 3.6.6 (default, Sep 12 2018, 18:26:19)
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]]
wxPython version: 4.0.1 (wxWidgets 3.0.4)
SQLAlchemy version: 1.2.12
Logbook version: 1.4.0
Requests version: 2.18.4
Dateutil version: 2.7.3

####################

Traceback (most recent call last):
File “/home/viking/bin/pyfa/pyfa.py”, line 131, in
from gui.mainFrame import MainFrame
File “/home/viking/bin/pyfa/gui/mainFrame.py”, line 72, in
from service.update import Update
File “/home/viking/bin/pyfa/service/update.py”, line 33, in
from packaging.version import Version
ModuleNotFoundError: No module named ‘packaging’

If I close that and run the python script I get the below error:

$ ./pyfa.py
Traceback (most recent call last):
File “./pyfa.py”, line 27, in
import config
File “/home/viking/bin/pyfa/config.py”, line 4, in
from logbook import CRITICAL, DEBUG, ERROR, FingersCrossedHandler, INFO, Logger, NestedSetup, NullHandler,
ImportError: No module named logbook

What did I do or not do? I know that logbook is installed by the following:

$ pip3 list
DEPRECATION: The default format will switch to columns in the future. You can use --format=(legacy|columns) (or define a format=(legacy|columns) in your pip.conf under the [list] section) to disable this warning.
apturl (0.5.2)
asn1crypto (0.24.0)
Brlapi (0.6.6)
certifi (2018.1.18)
chardet (3.0.4)
command-not-found (0.3)
cryptography (2.1.4)
cupshelpers (1.0)
cycler (0.10.0)
defer (1.0.6)
distro-info (0.18)
evdev (0.7.0)
httplib2 (0.9.2)
idna (2.6)
keyring (10.6.0)
keyrings.alt (3.0)
kiwisolver (1.0.1)
language-selector (0.1)
launchpadlib (1.10.6)
lazr.restfulclient (0.13.5)
lazr.uri (1.0.3)
Logbook (1.4.0)
louis (3.5.0)
lutris (0.4.19)
macaroonbakery (1.1.3)
Mako (1.0.7)
markdown2 (2.3.5)
MarkupSafe (1.0)
matplotlib (3.0.0)
numpy (1.15.2)
oauth (1.0.1)
olefile (0.45.1)
pexpect (4.2.1)
Pillow (5.1.0)
pip (9.0.1)
protobuf (3.0.0)
pycairo (1.16.2)
pycrypto (2.6.1)
pycups (1.9.73)
pygobject (3.26.1)
pymacaroons (0.13.0)
PyNaCl (1.1.2)
pyparsing (2.2.1)
Pypubsub (4.0.0)
pyRFC3339 (1.0)
python-apt (1.6.2)
python-dateutil (2.7.3)
python-debian (0.1.32)
pytz (2018.3)
pyxattr (0.6.0)
pyxdg (0.25)
PyYAML (3.12)
reportlab (3.4.0)
requests (2.18.4)
requests-unixsocket (0.1.5)
roman (3.0)
SecretStorage (2.3.1)
setuptools (40.4.3)
simplejson (3.13.2)
six (1.11.0)
SQLAlchemy (1.2.12)
system-service (0.3)
systemd-python (234)
ubuntu-drivers-common (0.0.0)
ufw (0.35)
unattended-upgrades (0.1)
urllib3 (1.22)
usb-creator (0.3.3)
wadllib (1.3.2)
wheel (0.30.0)
wxPython (4.0.1)
xkit (0.0.0)
youtube-dl (2018.3.14)
zope.interface (4.3.2)


(Anderson Geten) #12

my bad, I corrected the OP.
the requirement is python-dateutil, not dateutil.


(Anderson Geten) #13

hmm I made a few mistakes in OP, try again ?


(MorsMortis Shiyurida) #14

Sorry for the late response. Below is the error that I am still receiving. It appears to be the same one as before.

pyfa v2.4.0 (git)
EVE Data Version: 1369747 (2018-08-21 20:33:06)

OS version: Linux-4.15.0-34-generic-x86_64-with-Ubuntu-18.04-bionic
Python version: 3.6.6 (default, Sep 12 2018, 18:26:19)
[GCC 8.0.1 20180414 (experimental) [trunk revision 259383]]
wxPython version: 4.0.1 (wxWidgets 3.0.4)
SQLAlchemy version: 1.2.12
Logbook version: 1.4.0
Requests version: 2.18.4
Dateutil version: 2.7.3

####################

Traceback (most recent call last):
File “/home/viking/bin/pyfa/pyfa.py”, line 131, in
from gui.mainFrame import MainFrame
File “/home/viking/bin/pyfa/gui/mainFrame.py”, line 72, in
from service.update import Update
File “/home/viking/bin/pyfa/service/update.py”, line 33, in
from packaging.version import Version
ModuleNotFoundError: No module named ‘packaging’


(Anderson Geten) #15

pip3 --version ?

BTW this script worked for me (almost), I’m not a dev who want to spend time for people so please if you have a solution post it.


(MorsMortis Shiyurida) #16

python3-pip/bionic-updates,bionic-updates,now 9.0.1-2.3~ubuntu1 all [installed]


(Anderson Geten) #17

this is not what I asked for.

Please do exactly how I ask otherwise this is a loss of time for you and me

Anyhow there is not a lot I can do, it works for me so I guess you have to tinker until you find the solution.


(MorsMortis Shiyurida) #18

Sorry about that. I had to find the correct command.

~$ pip3 --version
pip 18.0 from /home/viking/.local/lib/python3.6/site-packages/pip (python 3.6)


(Nana Skalski) #19

I just unzip and when it is microsoft it just works for me.


(Anderson Geten) #20

Why are you logged as root ? Some programs are supposed to be used as non-root user and will behave badly if you do so.