Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automated installation script on Ubuntu 18.10 #11

Open
zdomjus60 opened this issue Nov 2, 2018 · 11 comments
Open

Automated installation script on Ubuntu 18.10 #11

zdomjus60 opened this issue Nov 2, 2018 · 11 comments

Comments

@zdomjus60
Copy link

Not an issue, really. I found that compiling from source can lead to unexpected fails, so I wrote a short script in order to use available resources from the ubuntu repository. The script must be made executable the normal way: sudo chmod a+x uPyCraft_installation.txt then executed ./uPyCraft_installation.txt. This script has worked fine in three different ubuntu machines, I think it can be optimized. The final executable uPyCraft can be found in uPyCraft_src/dist directory.
Hope to be of some usefulness.
uPyCraft_installation.txt
Tested on Bodhi (Ubuntu 18.04 based) and Antix (Debian stretch based, 32 bits version), it works fine. If the script crashes on pyinstaller installation, try this command from command line:
pip3 install --upgrade setuptools then relaunch the script.

@ouki-wang
Copy link
Contributor

Thank you very much, I have received this document. Currently Linux only supports one version, the next version will integrate your results. Thanks again

@zdomjus60
Copy link
Author

Thank you ouki-wang, uPyCraft is a wonderful piece of software and makes using Micropython on esp32 and esp8266 boards a breeze. Perharps my script is a little cumbersome, but it gets all needed software parts from common repositories, without extra compiling. I'm absolutely not an expert, but I'm glad to contribute.

@patfrench
Copy link

Hi all,
I'm french, sorry for my english. I have a problem on linux mint 18 sarah (i386), after run a automatic script

`~/Téléchargements/uPyCraft_src/dist $ ./uPyCraft
Fatal Python error: Py_Initialize: Unable to get the locale encoding
LookupError: unknown encoding: UTF-8

Current thread 0xb7563980 (most recent call first):
Abandon
`
you can help me ?

@patfrench
Copy link

problem found for encoding UTF8, (enum34 not compatible)
pip3 uninstall enum34

problem found for setuptools (installation of pyinstaller)
sudo apt-get install python3-setuptools

Now new problem :-(
~/Téléchargements/uPyCraft_src/dist $ ./uPyCraft Traceback (most recent call last): File "uPyCraft.py", line 2, in <module> ModuleNotFoundError: No module named 'PyQt4' [15456] Failed to execute script uPyCraft

@zdomjus60
Copy link
Author

@patfrench I had similar problems with my script in linux mint 19, above all with python3 and pyinstaller. Try running my script, it's downloadable from the very first message. As I suggested before, if it crashes during pyinstaller execution, try
sudo pip3 install --upgrade setuptools
and relaunch the script. Setuptools can be tricky sometimes.

@patfrench
Copy link

hi
i don't understand, i have launch your script.
Your script is perfect = no error

i have an error here :
~/Téléchargements/uPyCraft_src/dist $ ./uPyCraft Traceback (most recent call last): File "uPyCraft.py", line 4, in <module> ImportError: cannot import name 'Qsci' [13865] Failed to execute script uPyCraft

i am on anaconda, may be a problem of path ?

thanks

@zdomjus60
Copy link
Author

zdomjus60 commented Nov 4, 2018

@patfrench To replicate your problem, I have installed linux mint 18 and anaconda in a virtual machine, I have run the script and the result is a full working executable (I should say aggregate, pyinstaller doesn't create a true compiled executable). Unfortunately, trying to run the uPyCraft.py file in IDLE3 it crashes miserably at the first lines, because it doesn't find the Qt4 module.
As a workaround you can try to modify the uPyCraft.py file adding two lines of code at the very beginning:

import sys
sys.path.append('/usr/lib/python3/dist-packages')

you should check the path for the presence of Qt4 module. Save the file. Try to run in IDLE3 or other suitable python ide and check for further errors.

@patfrench
Copy link

Hi,
I have re-install Linux yesterday (Linux mint 19 64bits) and no problem for install uPycarft.
I have launch your script without problem.

For Linux sarah 32bits with anaconda3, i don't know !?!?!?!?!?!? I abandoned ...

Thank you very much

@wr300000
Copy link

wr300000 commented Jun 30, 2019

hi zdomjus60
thank, it's success to bring up uPycraft on my Dell 64bit ubuntu 18.04.2 64bit desktop and my ole Toshiba NB200 Intel Atom N280 cpu, with Mint 19.1 Mate 32bit. It seems that we need to do "pip3 install --upgrade setuptools" after first run as your suggestion on my both laptops. thank you for your kindness

@Qudor-Engineer
Copy link

@patfrench To replicate your problem, I have installed linux mint 18 and anaconda in a virtual machine, I have run the script and the result is a full working executable (I should say aggregate, pyinstaller doesn't create a true compiled executable). Unfortunately, trying to run the uPyCraft.py file in IDLE3 it crashes miserably at the first lines, because it doesn't find the Qt4 module.
As a workaround you can try to modify the uPyCraft.py file adding two lines of code at the very beginning:

import sys
sys.path.append('/usr/lib/python3/dist-packages')

you should check the path for the presence of Qt4 module. Save the file. Try to run in IDLE3 or other suitable python ide and check for further errors.

Thank you, your solution working fine on Ubuntu 18.04

@ioseluiz
Copy link

ioseluiz commented Apr 4, 2020

Thanks! It worked.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants