Permission denied due to scipy while installing Theano - permissions

I'm installing Theano on a server where I'm not the root.
I ran
pip install Theano --user
which returns the following error
Installing collected packages: scipy
Found existing installation: scipy 0.9.0
Uninstalling scipy:
Exception:
Traceback (most recent call last):
File "/usr/lib/python2.7/dist-packages/pip/basecommand.py", line 126, in main
self.run(options, args)
File "/usr/lib/python2.7/dist-packages/pip/commands/install.py", line 228, in run
requirement_set.install(install_options, global_options)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1089, in install
requirement.uninstall(auto_confirm=True)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 476, in uninstall
paths_to_remove.remove(auto_confirm)
File "/usr/lib/python2.7/dist-packages/pip/req.py", line 1391, in remove
renames(path, new_path)
File "/usr/lib/python2.7/dist-packages/pip/util.py", line 248, in renames
shutil.move(old, new)
File "/usr/lib/python2.7/shutil.py", line 300, in move
os.unlink(src)
OSError: [Errno 13] Permission denied: '/usr/share/pyshared/scipy-0.9.0.egg-info'
so apparently, Theano wants to install scipy, but it's already installed, so it attempts to uninstall it first, which brings the permission issue.
How can I go around it so as to not uninstall scipy, but use the existing one?

The problem is that the scipy-version you have installed is not recommended. Theano usually needs at least version 0.11 to work. It seems that your version is also working but has some known bugs. (Installation Instructions) If you wish to use your old version and risk the bugs, you should be able to use:
pip install Theano --user --no-dependencies
Note that the other two requirements numpy and six will also not be checked and updated

Related

How to import h3-py (uber) on windows after installing it?

I want to ask about h3-py installation on windows
I have tried to install h3 on windows with python
I ran the command pip install h3 and it is installed.
After install, when I try to import it, i get this error:
from h3 import h3
File "C:\Users\ASUS\AppData\Local\Programs\Python\Python36\lib\site-packages\h3\h3.py", line 39, in <module>
libh3 = cdll.LoadLibrary('{}/{}'.format(_dirname, libh3_path))
File "C:\Users\ASUS\AppData\Local\Programs\Python\Python36\lib\ctypes\__init__.py", line 426, in LoadLibrary
return self._dlltype(name)
File "C:\Users\ASUS\AppData\Local\Programs\Python\Python36\lib\ctypes\__init__.py", line 348, in __init__
self._handle = _dlopen(self._name, mode)
OSError: [WinError 126] The specified module could not be found
We're in the process of migrating the wrapper to Cython at https://github.com/uber/h3-py/tree/cython
Would you mind trying to install this cython version with these (temporary) install steps:
pip install scikit-build
pip install git+https://github.com/uber/h3-py.git#cython
Edit:
We've released 3.6.1 along with pre-built wheels on PyPI and conda. Install should now be as simple as
pip install h3
Apprently there was a problem with the package and after fixing it in the release v3.6.1 it works. they fixed install issues.
As mentioned in this issue on github :
https://github.com/uber/h3-py/issues/32

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?

Failed building wheel for pyarrow

I am trying to pip install Superset
pip install apache-superset
and getting below error
Traceback (most recent call last):
File "c:\users\saurav_nimesh\appdata\local\programs\python\python38\lib\runpy.py", line 193, in _run_module_as_main
return _run_code(code, main_globals, None,
File "c:\users\saurav_nimesh\appdata\local\programs\python\python38\lib\runpy.py", line 86, in _run_code
exec(code, run_globals)
File "C:\Users\saurav_nimesh\AppData\Local\Programs\Python\Python38\Scripts\cmake.exe\__main__.py", line 4, in <module>
ModuleNotFoundError: No module named 'cmake'
error: command 'C:\\Users\\saurav_nimesh\\AppData\\Local\\Programs\\Python\\Python38\\Scripts\\cmake.exe' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for pyarrow
Failed to build pyarrow
ERROR: Could not build wheels for pyarrow which use PEP 517 and cannot be installed directly
Tried Installing Windows 10 sdk and updating Visual studio tools
Please help with basic step, I am level 0 in python doing it just to get to Superset
Apache Superset is pinned on pyarrow==0.15.1 which is not available on Python 3.8, and I don't recommend trying to get the build-from-source to work.
Please ask the Superset developers to update to pyarrow==0.16.0 or higher. In the meantime, you can use Python 3.7 or lower.
I solved it by upgrading pip setuptools wheel based on another ancient post.
pip install --upgrade pip setuptools wheel
Re: https://github.com/pydata/bottleneck/issues/281

faulty install of Matplotlib

Windows7 with python 3.4 32bit.
Downloaded and ran install according to this related question.
However I have a different error, so I posted a new question.
I removed the faulty install and tried the installer from the sourceforge link off matplotlib.org. Both finish claiming to be successful, though testing results in an error (both resulting in the same error)
from matplotlib import *
Traceback (most recent call last):
File "<pyshell#2>", line 1, in <module>
from matplotlib import *
File "C:\Python34\lib\site-packages\matplotlib\__init__.py", line 105, in <module>
import six
ImportError: No module named 'six'
Actually you need to install six. As given in Python Error: "ImportError: No module named six"
Better you can install pip and install all libraries using that.

My ipython and libraries disabled after installing OS X 10.8 (Mountain Lion)

I have a problem similar to this one below:
Python pip broken after OS X 10.8 upgrade
After installing ML, I can no longer use iPython, SciPy or Matplotlib. I get this error:
Shanes-MacBook-Pro:~ $ ipython
Traceback (most recent call last):
File "/usr/local/bin/ipython", line 5, in <module>
from pkg_resources import load_entry_point
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 2603, in <module>
working_set.require(__requires__)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 666, in require
needed = self.resolve(parse_requirements(requirements))
File "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/pkg_resources.py", line 565, in resolve
raise DistributionNotFound(req) # XXX put more info here
pkg_resources.DistributionNotFound: ipython==0.14.dev
I have tried the following to fix it:
Using sudo ipython
Installing latest Xcode
Reinstalling SciPy superpack
When I type which python it says it is in /usr/bin/python.
Extra information:
nside /Library/python/2.7/site-packages
Inside there is the following:
DateUtils-0.5.2-py2.7.egg
README
easy-install.pth
nose-1.1.2-py2.7.egg
pika-0.9.5-py2.7.egg
pyzmq-2.2.0.1-py2.7-macosx-10.8-intel.egg
tornado-2.3-py2.7.egg
So with this ML upgrade, it removed my numpy, ipython, etc. And it does not install there anymore like it did with lion. How can I find where it installs too because it seems like it is working when I run the install_superpack shell script.
As an update, I never fixed this specific problem. However, I just downloaded the iPython, SciPy, Matplotlib etc. from Enthought. I answered someone elses question on how to do this here:
How to check whether I have IPython installed on my machine and what sequence to install these libraries?