numpy.test error in virtualenv with ERROR: test_multiarray.TestNewBufferProtocol.test_relaxed_strides - numpy

In my ubuntu system,i install numpy in virtualenv with python 2.7. After i install it, using the numpy.test:
python -c "import numpy; numpy.test()"
there are some errors like this:
ERROR: test_multiarray.TestNewBufferProtocol.test_relaxed_strides
Traceback (most recent call last):
File "/home/zjd/wangliangguo/theano-env/local/lib/python2.7/site- packages/nose/case.py", line 197, in runTest
self.test(*self.arg)
File "/home/zjd/wangliangguo/theano-env/local/lib/python2.7/site-packages/numpy/core/tests/test_multiarray.py", line 5366, in test_relaxed_strides fd.write(c.data)
TypeError: 'buffer' does not have the buffer interface

I had the same error with Python 2.7.3. Upgrading to Python 2.7.11 fixed it for me.
I'm on Ubuntu 12.04 LTS, and the default apt-get repositories didn't have Python 2.7.11, so I followed these instructions: https://superuser.com/a/942296

Related

Jenkins : Pycharm : I keep getting a message to upgrade pip

Im trying to run automated test on jenkins cloud version : so i get this error :
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-0739wibs/cryptography/setup.py", line 14, in <module>
from setuptools_rust import RustExtension
ModuleNotFoundError: No module named 'setuptools_rust'
Command "python setup.py egg_info" failed with error code 1 in /tmp/pip-build-0739wibs/cryptography/
You are using pip version 9.0.3, however version 22.0.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Import chromedriver on the env variable.
Import python path on the env variable.
/tmp/jenkins3940904514869226010.sh: line 16: pytest: command not found
Build step 'Execute shell' marked build as failure
Finished: FAILURE
I do `python3 -m pip install --upgrade pip
I get Requirement already satisfied: pip in ./venv/lib/python3.8/site-packages (22.0.3)
`
I have fixed it by adding this line on Execute shell
pip3 install --upgrade pip

How to install matplotlib 3.2.x on Ubuntu 16.04?

Tried several methods to install matplotlib on Ubuntu 16.04, but failed miserably. First I ran
sudo apt-get install python3-matplotlib, it always installed matplotlib 1.5.1 and I wanted the latest version 3.2.1. So I purged it and ran pip3 install matplotlib and what I got was always the following error
Complete output from command python setup.py egg_info:
Traceback (most recent call last):
File "<string>", line 1, in <module>
File "/tmp/pip-build-hse72gvy/matplotlib/setup.py", line 139
raise IOError(f"Failed to download jquery-ui. Please download "
^
SyntaxError: invalid syntax
which seems to suggest that I must install jQuery-UI. I haven't found any working solutions on the internet. Any more has a tip or solution?

Tensorflow CPU Version Installation Error

I am running Ubuntu by using Virtualbox on Windows10.
I installed Tensorflow CPU version in terminal using pip3 install --upgrade tensorflow as per instruction given in official site of Tensorflow. And when I tried to validate installation as import tenorflow as tf it showed following error:
Traceback (most recent call last):
File "<stdin>", line1, in <module>
ImportError: No module named tensorflow
What should I do, to fix this error?

skflow with Docker images gets learn.datasets not imported error

I set the docker image with Dockerfile below.
FROM gcr.io/tensorflow/tensorflow:latest-devel
RUN pip install --upgrade pip
RUN pip install scikit-learn
RUN pip install scipy
RUN pip install pandas
I am using Pycharm and set the remote Docker tf library.
The below file runs with an error which says ' AttributeError: 'module' object has no attribute 'datasets' '
https://github.com/tensorflow/tensorflow/blob/cc9bfbf8ef4a3dea6514ad939d238f7442188247/tensorflow/examples/skflow/text_classification_cnn.py
Do I have to compile some source codes before running the test code, or can I not run the code in Windows? Below is the error messages.
f58474f68f97:python -u /opt/project/examples/skflow/text_classification_cnn.py
Traceback (most recent call last):
File "/opt/project/examples/skflow/text_classification_cnn.py", line 30, in <module>
dbpedia = learn.datasets.load_dataset('dbpedia')
AttributeError: 'module' object has no attribute 'datasets'
Please update your TensorFlow to latest version. That docker image is probably outdated.

Install matplotlib with Plone 4.3.3 via buildout [duplicate]

When I try to upgrade my matplotlib using pip, it outputs:
Downloading/unpacking matplotlib from https://pypi.python.org/packages/source/m/matplotlib/matplotlib-1.4.0.tar.gz#md5=1daf7f2123d94745feac1a30b210940c
Downloading matplotlib-1.4.0.tar.gz (51.2MB): 51.2MB downloaded
Running setup.py (path:/tmp/pip_build_root/matplotlib/setup.py) egg_info for package matplotlib
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [1.4.0]
python: yes [2.7.6 (default, Mar 22 2014, 22:59:38) [GCC
4.8.2]]
platform: yes [linux2]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.8.2]
six: yes [using six version 1.7.3]
dateutil: yes [using dateutil version 2.2]
tornado: yes [using tornado version 4.0.1]
pyparsing: yes [using pyparsing version 2.0.2]
pycxx: yes [Couldn't import. Using local copy.]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/matplotlib/setup.py", line 154, in <module>
result = package.check()
File "setupext.py", line 940, in check
if 'No such file or directory\ngrep:' in version:
TypeError: argument of type 'NoneType' is not iterable
Complete output from command python setup.py egg_info:
============================================================================
Edit setup.cfg to change the build options
BUILDING MATPLOTLIB
matplotlib: yes [1.4.0]
python: yes [2.7.6 (default, Mar 22 2014, 22:59:38) [GCC
4.8.2]]
platform: yes [linux2]
REQUIRED DEPENDENCIES AND EXTENSIONS
numpy: yes [version 1.8.2]
six: yes [using six version 1.7.3]
dateutil: yes [using dateutil version 2.2]
tornado: yes [using tornado version 4.0.1]
pyparsing: yes [using pyparsing version 2.0.2]
pycxx: yes [Couldn't import. Using local copy.]
libagg: yes [pkg-config information for 'libagg' could not
be found. Using local copy.]
Traceback (most recent call last):
File "<string>", line 17, in <module>
File "/tmp/pip_build_root/matplotlib/setup.py", line 154, in <module>
result = package.check()
File "setupext.py", line 940, in check
if 'No such file or directory\ngrep:' in version:
TypeError: argument of type 'NoneType' is not iterable
----------------------------------------
Cleaning up...
Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/matplotlib
Storing debug log for failure in /home/username/.pip/pip.log
In the tail of the log it says:
Exception information:
Traceback (most recent call last):
File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/basecommand.py", line 122, in main
status = self.run(options, args)
File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/commands/install.py", line 278, in run
requirement_set.prepare_files(finder, force_root_egg_info=self.bundle, bundle=self.bundle)
File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 1229, in prepare_files
req_to_install.run_egg_info()
File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/req.py", line 325, in run_egg_info
command_desc='python setup.py egg_info')
File "/usr/local/lib/python2.7/dist-packages/pip-1.5.6-py2.7.egg/pip/util.py", line 697, in call_subprocess
% (command_desc, proc.returncode, cwd))
InstallationError: Command python setup.py egg_info failed with error code 1 in /tmp/pip_build_root/matplotlib
Why did it fail?
Many thanks!
This is a known bug that has been fixed (https://github.com/matplotlib/matplotlib/pull/3414) on master.
The bug is in the handling of searching for a freetype installation. If you install the Linux package freetype-dev, you will avoid this bug and be able to compile matplotlib.
sudo apt-get install libfreetype6-dev
On Ubuntu 14 server, you also need to install libxft-dev
sudo apt-get install libfreetype6-dev libxft-dev
I had the same issues trying to install matplotlib on Python 3 using pip3, and it seems that this problem is related to a bare-bones installation of Python 3, and doing a:
sudo apt-get build-dep matplotlib
followed by
sudo pip3 install matplotlib
is probably a better solution than selectively installing only the libraries related to matplotlib.
Since mac doesn't have apt-get you, on OSX you may need to do:
brew install freetype
then you can run:
pip install matplotlib
Found this page while looking answer for fedora 24.
RPM solution is:
dnf install freetype-devel
If you re running Ubuntu server 14.04 u should add this font dependency
sudo apt-get install libxft-dev
Source
I was trying too update directly using sudo pip but changes are not saved in last. So i first use update cmd in terminal:
sudo apt-get update
then i used sudo install:
sudo apt-get install libffi-dev
Finally its installed by doing this method.
For those on Fedora 25 hitting this thread, I needed these two packages to make it work:
sudo dnf install freetype-devel gcc-c++
This worked for me:
python -m pip install -U pip setuptools
python -m pip install matplotlib
For more details, follow : https://matplotlib.org/2.0.0/users/installing.html