I tried installing anaconda on the Raspberry Pi using the 32 bit installer in their webpage. After finding out where the file is located I put the command
bash ~/Downloads/Anaconda3-5.1.0-Linux-x86.sh
Once the installation location was picked, I got the following error.
installing: python-3.6.4-hc3d631a_1 ...
/home/pi/Downloads/Anaconda3-5.1.0-Linux-x86.sh: line 373: /home/pi/anaconda3/pkgs/python-3.6.4-hc3d631a_1/bin/python: cannot execute binary file: Exec format error
Any idea how to install anaconda?
The problem is that you try to install Anaconda for x86 CPUs (such as Intels) whereas the Raspberry Pi has an ARM based CPU. You need to use the following install script:
wget http://repo.continuum.io/miniconda/Miniconda3-latest-Linux-armv7l.sh
chmod +x Miniconda3-latest-Linux-armv7l.sh
./Miniconda3-latest-Linux-armv7l.sh
You may check the file permissions such
sudo chmod 775 Anaconda3-5.1.0-Linux-x86.sh
Alternatively you may just run with ./Anaconda3-5.1.0-Linux-x86.sh
Related
I used: "sudo apt-get install idle3" and "sudo apt install idle" in my attempts to install Python IDLE from the terminal. Both worked fine, with a successful installation message afterwards. However, when I type $ idle or $ idle3, nothing happens. When I tried to open it from the "Applications" menu, it also would not open. (Note: I can set up a python file and run it without trouble, so I am sure that both Python2 and 3 are properly installed.) Any suggestions on how to make IDLE run correctly, or maybe to reinstall it a different way so that it actually opens?
I'm currently trying to install python36 onto the main pfsense system, this is so I can get netdata and a few other things installed.
However, I'm having problems with trying to find the command too download it. Just keeps telling me it can't find python, py36 or anything of the such, if you could please let me know the commands needed to download python 36 that would be great.
Thanks
pfSense is based on FreeBSD so you have to try
sudo portmaster lang/python3
(This will build from source, including its dependencies)
or
sudo pkg install python3
(To only fetch binary files)
To search about more python3 packages, then run following command in terminal:
psearch python3
I'm on Windows and want to use the Python package apt_pkg in PyCharm.
On Linux I get the package by doing sudo apt-get install python3-apt but how to install apt_pkg on Windows?
There is no such package on PyPI.
There is no way to run apt-get in Windows; the package format and the supporting infrastructure is very explicitly Debian-specific.
Not quite what you're looking for, but it's possible to use apt-offline on Windows to download the packages. However, you still need a Linux box to generate the sig file.
For example:
python apt-offline set vim-offline.sig --install-packages vim
Will not work:
ERROR: This argument is supported only on Unix like systems with apt installed
However, if you run that command on Linux first, the following command should work on Windows:
python apt-offline get vim-offline.sig -d vim
apt-offline source is available here:
https://github.com/rickysarraf/apt-offline
To build it, simply run:
python setup.py build
python setup.py install
I got it to run with Python 3.8.2 on Windows 10.
Note: in the end of the day, you're just downloading a .deb package and it is simply an ar file containing a tarball and can be extracted with tools like 7-zip. However, if it contains a Linux binary (vim example), there isn't much you can do with it on Windows.
One can use chocolatey the equivalent for windows.
https://chocolatey.org/install
add it to the windows PATH environment
C:\ProgramData\chocolatey\bin
Restart python or anaconda. And is ready to use.
To install packages inside a .py script or a Jupiter notebook, use the syntax below
!choco install [package name]
I am trying to use the Python SDK for the IoT Hub by running the example code: "SimulatedDevice.py" but the code breaks on the same exception on 3 different raspbian devices as well as my PyCharm environment.
In trying to run the SimulatedDevice.py example on my Raspberry Pi, the code always breaks with an:
"ImportError: libboost_python-py27.so.1.62.0: cannot open shared object file: No such file or directory"
initial error: "import iothub_client"
I have pip installed the azure-iothub-device-client as well as confirmed the version is python2.7 even trying to reinstall python. This is curious as when I run the exact same file on my Windows CMD the SimulatedDevice.py example code functions fine, it's only in the Python terminal and on the Raspberry Pi do I get this error.
As said in this great post
1st solution
are you running raspbian stretch or jessie? You probably want stretch now. it's the latest stable and that's the one we're testing against
is the libboost-python1.62.0 package installed? if not you can install it with: apt-get install libboost-python1.62.0
2nd solution
A user [ko5win] in that link with your same problem confirmed that a fresh raspberry pi with stretch and the proper version of libboost solved the pip version issue
Another user [sergiomfsilva] gives an alternative procedure:
Environment
OS and version used
Linux raspberrypi 4.14.30-v7+ #1102 SMP Mon Mar 26 16:45:49 BST 2018 armv7l GNU/Linux
Python runtime used: Python 3.5.3
SDK version used: 1.3.1
Workaround steps used
Get images and prepare to do the work:
get last Raspbian Lite Image
flash microSD card for Raspberry Pi3
boot with raspberry pi
login with pi user
make the command
sudo su
go to root folder
cd /root
Update the system and make some time checks
Do the next commands:
apt-get update && apt-get upgrade
apt-get install ntp
Check the RPI date with the command
date
After date ok all its ready
Note: Configure ntp.conf file if date issues found
Install required packages and review the error reported
Install required packages
apt-get install -y git cmake build-essential curl libcurl4-openssl-dev libssl-dev uuid-dev python3-pip
SDK cloning
git clone --recursive https://github.com/Azure/azure-iot-sdk-python.git
Install device client package using pip3
pip3 install azure-iothub-device-client
Go to samples folder
cd azure-iot-sdk-python/device/samples/
Run the sample code
python3 iothub_client_sample.py
The error must be the same:
Traceback (most recent call last): File
"iothub_client_sample.py", line 10, in import
iothub_client File
"/usr/local/lib/python3.5/dist-packages/iothub_client/init.py",
line 1, in from .iothub_client import *
ImportError: libboost_python-py34.so.1.55.0: cannot open shared object
file: No such file or directory
Build new libraries and apply it
Go to building folder for linux
cd /root/azure-iot-sdk-python/build_all/linux
Run Setup
./setup.sh --python-version 3.5
Replace openssl dev with gnutls dev already reported like solution for a curl out of memory issue
apt remove libcurl4-openssl-dev
apt install libcurl4-gnutls-dev
build libraries
./build.sh --build-python 3.5
Go to root folder
cd /root
Move created library to python iothub_client path
mv azure-iot-sdk-python/device/samples/iothub_client.so /usr/local/lib/python3.5/dist-packages/iothub_client/iothub_client.so
Go to samples folder
cd azure-iot-sdk-python/device/samples/
Run the sample code
python3 iothub_client_sample.py
This solves the issue found and works in the raspberry. This did not solve this issue because it is related with the pip package. To solve a new pip package with library and python version updated
I tried to install distribute or setuptools which has to be done prior to installing pip on the Raspberry Pi.
The command used was $ curl http://python-distribute.org/distribute_setup.py | python
However I got the following error. I can copy past the entire terminal script if requested.
[Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/test-easy-install-2082.pth'
Thanks for helping!
I have never using raspberry pi. But from the log can be seen it complain about cannot have permission to modify python package directory. You have to run pip install using root privilege.
This answer is based on what ever operating system you have but one that is specifically Linux based like raspbian you should open up terminal and type in chmod +x file path here. Also for this to work you should be inside where ever the file is stored when you run chmod +x etc... /Desktop/python/ for example would work.
try
sudo curl http://python-distribute.org/distribute_setup.py | python command
some permisssions problem are resolved like this. I'm not sure if this works.