-1

I would like to port my script, that is great on desktop, to RPi. It is a general question, but just for an example I show my first lines:

from http.server import BaseHTTPRequestHandler,HTTPServer
import cgi

I can put pip list and I dont see my modules, neither many modules seen on desktop (this is the reason for this Question), however many are written in plain python, no compilation needed (IMHO).

  • Is somebody working on it? Or no progress expected? Can one manage by himself?

I searched a bit Can I run Python 3.3+ on Raspbian Jessie? and What programming languages does the Raspberry Pi support?, but I have not a clear mind about the depths of support of Python.

In Build something that requires dh-python I see somebody tackled the problem, but the idea is not very clear to me.

Edit: if the question is downvoted, would be very nice to give a hint where is a problem. Thank you Edit2: http.server cannot by found

Edit3: The question deserved -1. Details in my answer bellow

  • I actually used a short webserver code, that is proxy the open-street-maps servers. This way it is possible easily to make an offline gps map system for RPi. Pitty I cannot get through – jaromrax Feb 8 '17 at 13:26
  • 2
    You can use pip to install Python packages on the Pi - which in this case is more or less a general purpose computer. Some packages require compiling which could take some time on the Pi (e.g. numpy - it's quite heavy, takes hours). But most other packages should work fine. Just give it a try. – Ghanima Feb 8 '17 at 13:29
  • I wrote in text, that I tried pip list - I will edit with explicite - the modules dont exist. So I gave a try, now I need some hint – jaromrax Feb 8 '17 at 13:46
  • 1
    pip list shows the packages installed not the packages on the repo. Did you try to install them pip install <name>? Or pip3 for that matter. – Ghanima Feb 8 '17 at 14:47
  • The http and cgi modules are built in - you dont need pip to use them. Have you tried to run your code? – tobyd Feb 8 '17 at 14:50
1

Thank you for the help. I should have put the question accurately - but I did not know how. Now I would like to share my finding.

1/ Old RPi - it is important the RPi version - my code did not work, partially because I tried it on old RPi with debian wheezy. From now on I stick to RPi3, one can save lot of pain.

2/ Different Pythons - I have miniconda3 installed...now I see there are

  1. python 2.x. in /usr/bin/
  2. python 3.x in /usr/bin
  3. miniconda local install (that was my case and my problems, dont ask me why)

    I finally got successful with orignal python3 i.e. #!/usr/bin/python3 in the script.

3/ apt installs - many problems were solved by sudo pip3 install something-missing. But sometimes, I had to use repositories like apt-get install python3-tk.

I have not yet all working, but numpy, http, staticmaps, tkinter are installed and I can continue. Thank you guys, discussions helped me, at least I knew it was my problem, not RPi.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.