I'm trying to install SimpleCV on a RaspberryPi 2 running Ubuntu 14.04 LTS. I don't believe this to be be specific to the Pi or even to Ubuntu, it is more a general question and I feel OK to ask here.
I'm following the directions at
https://github.com/sightmachine/SimpleCV/blob/develop/doc/HOWTO-Install%20on%20RaspberryPi.rst
When trying the first part of step 4 I get a long list of trace then a "memory error"
When trying the second part I get the following error
Collecting PIL (from -r requirements.txt (line 3))
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Could not find a version that satisfies the requirement PIL (from -r requirements.txt (line 3)) (from versions: )
Some externally hosted files were ignored as access to them may be unreliable (use --allow-external PIL to allow).
No matching distribution found for PIL (from -r requirements.txt (line 3))
and breaking it further down I get an error trying to install PIL by itself (well, forcing it really, but apparently not hard enough...)
robert#furbot:~/Code/SimpleCV$ pip install --allow-external --allow-unverified PIL
Collecting PIL
/usr/local/lib/python2.7/dist-packages/pip/_vendor/requests/packages/urllib3/util/ssl_.py:90: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Could not find a version that satisfies the requirement PIL (from versions: )
Some externally hosted files were ignored as access to them may be unreliable (use --allow-external PIL to allow).
No matching distribution found for PIL
I notice that PIL is itself deprecated and wonder if there's a better way to do this ? The SSL error is common on this system it's a cause for concern but it's not really a mission critical exercise either. The goal is as said to install SimpleCV on a Ubuntu 14.04 system. I already have openCV compiled locally and it seems OK and I believe the system itself should be OK (I have a backup of its SD card...)
TIA
Rob
I ran into similar issues with installing PIL a few days ago on a Macbook. I ended up skipping that step altogether and proceeding with the other installs. When I tried to run the helloworld program, it threw a couple errors along the lines of "could not find x in PIL library," so I installed the pillow library instead, which was recommended in countless other SO questions related to PIL. It seemed to work fine after that. I know it's a different system from an RPi2, but I'd say give it a shot.
It would probably be easier here to follow the "install SimpleCV from source" instructions under step 4. Since it's looking for PIL in your requirements.txt, go ahead and edit that file to remove PIL from the list before running the line: sudo pip install -r requirements.txt. If that doesn't work, try replacing PIL with pillow.
Related
UPDATE 1: PIL and RDKIT produced import errors because the .dll files were not placed in /venv//Lib/site-packages
I removed both packages from environment and commented out their code from my project.
Next I updated the base base environment:
conda update conda #from base env
Then I upgraded pip and setuptools and reinstalled pillow:
python -m pip install pip --upgrade
pip install setuptools --upgrade
pip install pillow
I can now add my PIL content back to the project and it will work just fine on the production server, without rdkit installed.
RDKIT is only available as a conda install, it still does not install properly and breaks PIL in the process(rdkit depends on pillow). I have reinstalled from both the rdkit and conda-forge channels. Neither work.
What is the proper way to fix this problem? I feel like the hack around of moving .dll files is risky and not a good solution.
UPDATE 0: RDKIT will not load into any server
I created a basic django project similar to what you would find in the tutorial with no static files. The project successfully published to the Apache server describe below in the original post and in Windows 10 IIS. Next modified the models.py to import rdkit and both servers gave the import error and the site would not display.
Original post:
RDKIT is the only package not loading into our production server.
We successfully set up a Wampserver to run Apache and host our Django project . . .but have to comment out all the code associated with rdkit for it to work. This inhibits many required features.
There were no issues using rdkit in Django's test server.
Primary wsgi error:
from .rdBase import rdkitVersion as __version__\r, referer: http://localhost/APP/
ImportError: DLL load failed: The specified module could not be found.\r, referer: http://localhost/APP/
Relevant packages and version details:
Windows 10
Django 2.2
Python 3.7
conda 4.8.2
rdkit 2019.09.3 conda-forge
Wampserver 3.2
Apache 2.4.41
mod-wsgi 4.7.1
postgresql 10
The methods in this blog describe how we setup the production server. With one minor change, we did not alter the httpd_vhosts.conf file and only setup the standard localhost.
The error is reproducible by trying to import rdkit(or one of its methods) into any file needed to host a web application in the described environment.
We found this 2016 thread on the rdkit sourceforge and it sounds like someone else was having a similar problem on a Linux system. This is our first time setting up a server and we have not been successful at translating the recommended fix from linux to windows. There was no follow up to know if the recommendation was attempted let alone successful.
These 2012 slides lend us to believe someone was trying to overcome a similar issue in linux (slide 9)
How would a package need to be altered to allow it to load into a webserver?
Thank you, we greatly appreciate your time and assistance.
I have a local device farm that is running python 2.7.13 via Appium 1.6.5 on some android emulators. We want to increase our exposure and make use of the AWS device farm. The problem is that AWS only support Python 2.7.6 and they don't have plans to upgrade.
We need at least Python 2.7.9+ because any python below that doesn't support SSL with the "request" package.
We tried "request[security] == 2.9.1" but it introduces a dependency in the wheel packages that AWS doesn't support.
With python 2.7.6 on Windows and AWS we get the following errors when downloading packages with pip...
...
Collecting cryptography>=2.2.1 (from
pyOpenSSL>=0.13->requests[security]==2.9.1->-r
/tmp/scratchzAHCQI.scratch/test-packagep3mb8i/requirements.txt (line
5))
/tmp/scratchzAHCQI.scratch/tmpZjjNAE/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:90:
InsecurePlatformWarning: A true SSLContext object is not available.
This prevents urllib3 from configuring SSL appropriately and may cause
certain SSL connections to fail. For more information, see
https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning Downloading
https://files.pythonhosted.org/packages/22/21/233e38f74188db94e8451ef6385754a98f3cad9b59bedf3a8e8b14988be4/cryptography-2.3.1.tar.gz
(449kB)
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "", line 20, in
File "/tmp/pip-build-nqoNP_/cryptography/setup.py", line 28, in
"cryptography requires setuptools 18.5 or newer, please upgrade to a "
RuntimeError: cryptography requires setuptools 18.5 or newer, please upgrade to a newer version of setuptools
---------------------------------------- Command "python setup.py egg_info" failed with error code 1 in
/tmp/pip-build-nqoNP_/cryptography
/tmp/scratchzAHCQI.scratch/tmpZjjNAE/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:90:
InsecurePlatformWarning: A true SSLContext object is not available.
This prevents urllib3 from configuring SSL appropriately and may cause
certain SSL connections to fail. For more information, see
https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
/tmp/scratchzAHCQI.scratch/tmpZjjNAE/local/lib/python2.7/site-packages/pip/vendor/requests/packages/urllib3/util/ssl.py:90:
InsecurePlatformWarning: A true SSLContext object is not available.
This prevents urllib3 from configuring SSL appropriately and may cause
certain SSL connections to fail. For more information, see
https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning You are using pip version 7.1.2, however
version 18.0 is available. You should consider upgrading via the 'pip
install --upgrade pip' command.
An AWS support engineer mentioned that we can setup our own environment to support a new version of Python. However, the documentation is very confusing as it doesn't specify what the "Tech Spec" file should be called (I assume buildspec.yml), where I should put it, whether we should still use wheel or just pip?
Can I use apt or should I use yum?
I've looked around the internet but can't really find anything related to python and the AWS tech spec. All I want to do is install Python 2.7.9, install the requirements and trigger the tests and be able to make post to https REST services.
Have anyone had to solve this issue before?
You can choose just from default 2.7.6 vs optional 3.4.3. Follow this post to setup python 3 environment: https://forums.aws.amazon.com/message.jspa?messageID=865585#868262
I was trying to install tensorflow from source on ubuntu 14.04, python 2.7.
I followed the steps from "tensorflow.org" for source installation.
I had completed all the steps, such as bazel installation, python dependencies installation.
In the final step for sudo pip installation; the command was as follows:-
$sudo pip install /tmp/tensorflow_pkg/tensorflow-1.3.0rc0-cp27-none-linux_x86_64.whl
but i am getting error as follows:
Unpacking /tmp/tensorflow_pkg/tensorflow-1.3.0rc0-cp27-none-linux_x86_64.whl
Downloading/unpacking tensorflow-tensorboard (from tensorflow==1.3.0rc0)
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement tensorflow-tensorboard (from tensorflow==1.3.0rc0)
Cleaning up...
No distributions at all found for tensorflow-tensorboard (from tensorflow==1.3.0rc0)
Storing debug log for failure in /home/ubuntu/.pip/pip.log
i also checked tensorflow_pkg wheel :but the above package was not available there.
so can a different .whl can be insatlled using pip such as -tensorflow-1.2.1-cp27-none-linux_x86_64.whl
which have downloaded in my desktop.
Please tell me how i can resolve this issue.
Thanks and regards
I didn't figure out the root of the problem, but for what its worth I skipped the tensorboard issue by installing an older version (1.2.0 worked for me)
pip install https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.2.0-cp27-none-linux_x86_64.whl
Try:
pip install tensorflow
If that doesn't work:
sudo pip install --upgrade https://storage.googleapis.com/tensorflow/linux/cpu/tensorflow-1.2.1-cp27-none-linux_x86_64.whl
More info here and Common problems here.
My issue was resolved by following steps.
I updated the pip using
Also exported proxy settings.
e.g export https_proxy=...
This was able to resolve my issue.
I also tried installing other .whl file for tensorflow and yes tensorflow can be installed using the downloaded .whl file also.
Thank you
I got a Django project that was started without virtualenv. Now migrating to virtualenv and my requirements.txt created before is huge and not installable in the virtualenv (many errors as shown below). How can i generate a minimal list of required packages? Or is there some reference anywhere?
Could not find any downloads that satisfy the requirement PIL==1.1.7 (from -r requirements.txt (line 8))
Some externally hosted files were ignored (use --allow-external PIL to allow).
Cleaning up...
No distributions at all found for PIL==1.1.7 (from -r requirements.txt (line 8))
it's not only PIL that throws errors, if I comment it another package shows and i can't know what's really used for my application to work.
Thanks in advance!
You can run pip freeze (related to system python used before virtualenv), this give you list of installed packages;
Then filter that list using following:
1) INSTALLED_APPS in settings
2) also check all from and import statement (search through the project)
I've had the same problem and there are issues getting PIL to install using PIP as there's no PIL 1.7 in the default Python repos.
The easiest fix is this to add these options to the pip:
--allow-external PIL --allow-unverified PIL
For example:
pip install -r requirements.txt --allow-external PIL --allow-unverified PIL
The problem with this it is a potential security issue and you don't want to do this on a production server! :)
Your options are to use Pillow which is a fork of PIL:
https://pypi.python.org/pypi/Pillow
Comments from the Pillow author, and you should verify that it works with you code.
Or try PIL 1.1.6 which is the Python Repos:
https://pypi.python.org/pypi/PIL
Or create your own repo and include the PIL 1.1.7 sources.
Or, if your on a Linux system install PIL using your distro's package management tool and remove PIL from your requirements file, and then rebuild your virutalenv.
You can this on Debian based distros like this:
sudo apt-get install python-imaging
Red Hat distros like this:
sudo yum install python-imaging
Preface
I am so new to ssh/unix protocols that I hope I don't offend anybody.
Context
I am using the cores at my university, and do not have root access. Thus, when I install python modules, I resort to the answer on these two related stack overflow posts:
1) How to install python modules without root access?
2) How to install python packages without root privileges?
In the second post, Col Panic highly recommends getting pip or easy_install on the cores, and if they are not already there, 'you should politely ask the admins to add it, explaining the benefit to them (they won't be bothered anymore by requests for individual packages)."
Following that piece of advice, I request that the admin put easy_install on all the cores. They did and after some proverbial futzing around with export, PATH and PYTHONPATH, I was able to get numpy and scipy on the cores and import them into iPython environment.
Unfortunately, there was some problems with matplotlib related to this question: ImportError: No module named backend_tkagg
I thought I could just ignore this problem related to SUSE by pickling everything and then plotting it on my laptop.
My Problem
I really do need NetworkX. I wrote down some notes on all the small intricacies that I used to install the other packages my last go, but failed this time around. Maybe I am forgetting something that I did last time?
nemo01.65$ easy_install --prefix=/u/walnut/h1/grad/cmarshak/xdrive/xpylocal networkx
TEST FAILED: /u/walnut/h1/grad/cmarshak/xdrive/xpylocal/lib/python3.3/site-packages does
NOT support .pth files
error: bad install directory or PYTHONPATH
You are attempting to install a package to a directory that is not
on PYTHONPATH and which Python does not read ".pth" files from. The
installation directory you specified (via --install-dir, --prefix, or
the distutils default setting) was:
/u/walnut/h1/grad/cmarshak/xdrive/xpylocal/lib/python3.3/site-packages
and your PYTHONPATH environment variable currently contains:
'/u/walnut/h1/grad/cmarshak/xdrive/xpylocal/lib/python2.7/site-packages'
Here are some of your options for correcting the problem:
* You can choose a different installation directory, i.e., one that is
on PYTHONPATH or supports .pth files
* You can add the installation directory to the PYTHONPATH environment
variable. (It must then also be on PYTHONPATH whenever you run
Python and want to use the package(s) you are installing.)
* You can set up the installation directory to support ".pth" files by
using one of the approaches described here:
https://pythonhosted.org/setuptools/easy_install.html#custom-installation-locations
Please make the appropriate changes for your system and try again.
My Attemps to Fix This
I really do networkx otherwise I have to adjust a bunch of my code that I want to put on the clusters.
1) I typed in:
export PYTHONPATH=/u/walnut/h1/grad/cmarshak/xdrive/xpylocal/lib/python3.3/site-packages
into the bash environment. No luck...
2) I asked another grad for some help. He suggested I install pip via easy_install, which I did and then use:
pip install --user networkx
When I type in:
find ./local/lib/python2.7/site-packages/ | grep net
I get a ton of files that are all from the networkx library. Unfortunately, there is still some problems with dependencies.
THANK YOU IN ADVANCE FOR YOUR HELP. Really enjoy learning new things from your answers.
It looks like there are multiple versions of pip floating around (cf pip: dealing with multiple Python versions? ). Try installing pip using a specific version of easy_install. For example, this gave me a pip2.7
walnut.39$ easy_install-2.7 -U --user pip
Searching for pip
Reading https://pypi.python.org/simple/pip/
Best match: pip 1.5.6
Processing pip-1.5.6-py2.7.egg
pip 1.5.6 is already the active version in easy-install.pth
Installing pip script to /u/walnut/h1/grad/rcompton/.local/bin
Installing pip2.7 script to /u/walnut/h1/grad/rcompton/.local/bin
Installing pip2 script to /u/walnut/h1/grad/rcompton/.local/bin
Using /net/walnut/h1/grad/rcompton/.local/lib/python2.7/site-packages/pip-1.5.6-py2.7.egg
Processing dependencies for pip
Finished processing dependencies for pip
walnut.40$
Then use pip2.7
walnut.40$ pip2.7 install --user networkx
Also, for non-root package installations, I've got the follow lines in my .bashrc:
export PYTHONPATH=$PYTHONPATH:$HOME/.local/lib/python2.7/site-packages
export PATH=$PATH:~/.local/bin