Error when installing software in Jupyter - jupyter-notebook

I am running jupyter notebooks but when trying to install software with:
!pip install ipython-sql
it returns this error:
copying build/lib.linux-x86_64-2.7/prettytable.py -> /usr/local/lib/python2.7/dist-packages
error: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/prettytable.py'
And below, in red letter:
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-6I8SLA/prettytable/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-nL3KsL-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-6I8SLA/prettytable/
That is all information I have. Any idea how to fix it?

I recreated your problem and solved it using:
!pip install ipython-sql --user
I use Linux Mint and Python 3.4. Using the --user flag stores libraries in your home directory, in my case under ~/.local/lib/python3.4/site-packages.

Related

not able to install GCC on Solaris 11.4

I installed Solaris 11.4 x86 in VirtualBox. I need to install the GCC compiler so that I can run c code in Solaris. But each time I try to install the package this error occurs:
Errors were encountered while attempting to retrieve package or file data for the
requested operation. Details follow:
http protocol error: Unknown error code: 500 reason: Internal Server Error
URL: 'http://pkg.oracle.com/solaris/release/solaris/file/1/53eb07cd6fade116a6fdea7397c6839929ec0925'
publisher information:
I have used the following commands:
sudo pkg install developer/gcc/gcc-c-7
also tried -nv option
sudo pkg install -nv gcc
sudo pkg install -nv gcc-7
sudo pkg install -nv developer/gcc-7
see the output of the following command:
kashif#OS:~$ pkg list | grep GCC
output:
system/library/gcc/gcc-c++-runtime 7.3.0-11.4.0.0.1.14.0 i--
system/library/gcc/gcc-c++-runtime-7 7.3.0-11.4.0.0.1.14.0 i--
system/library/gcc/gcc-c-runtime 7.3.0-11.4.0.0.1.14.0 i--
system/library/gcc/gcc-c-runtime-7 7.3.0-11.4.0.0.1.14.0 i--
image below shows gcc package information from repostiry
I am trying to solve this problem for 2 days. I have read documentation from
https://docs.oracle.com/cd/E37838_01/html/E60979/publisher-config.html
I also tried to install developerstudio 12.6 but it didn't work.
overall picture of error and command:
I have googled for errors tried to find information about errors and searched for how to install GCC on Oracle Solaris 11. I couldn't find any solution to this problem.
Try "wget http://pkg.oracle.com/solaris/release/p5i/0/developer%2Fgcc.p5i" or your preferred gcc package and manually install it with pkg install. You can try:
pkg install -v
after downloading.

How to install wp cli on mac

I am running this command on my mac machine:
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
But I got this error:
Warning: Failed to create the file wp-cli.phar: Read-only file system
What should I do?

Running python3 -m venv project return exit status 1

According to the venv documentation in Python3:
Changed in version 3.5: The use of venv is now recommended for creating virtual environments.
With Python3.6 installed in my Ubuntu 16, I tried to create a Python project with command python3 -m venv project, but got the following error:
Error: Command '['/home/me/git/project/bin/python3', '-Im', 'ensurepip', '--upgrade', '--default-pip']' returned non-zero exit status 1.
Question: Why could this have happened? and how to resolve?
sudo apt-get install -y python3-pip is worth a try, based on https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-programming-environment-on-an-ubuntu-16-04-server
If that fails, what does python3 --version print?

Error setting up environment on Google Cloud Shell to use Cloud ML

Following instructions from https://cloud.google.com/ml/docs/how-tos/getting-set-up:
Created a project and started the Cloud Shell.
Ran below script to Install required tools and dependencies
curl https://raw.githubusercontent.com/GoogleCloudPlatform/cloudml-samples/master/tools/setup_cloud_shell.sh | bash
Expected outcome >>
"Success! Your environment has the required tools and dependencies." when the script finishes successfully.
Actual outcome >>
+ pip install --user --upgrade 'pillow>=3.4.2' --global-option=build_ext --global-option=--disable-jpeg
/usr/local/lib/python2.7/dist-packages/pip-8.1.1- py2.7.egg/pip/commands/install.py:180: UserWarning: Disabling all use of wheels due to the use of --build-options / --g
lobal-options / --install-options.
cmdoptions.check_install_build_global(options)
Collecting pillow>=3.4.2
Using cached Pillow-4.0.0.tar.gz
Collecting olefile (from pillow>=3.4.2)
Using cached olefile-0.43.zip
Installing collected packages: olefile, pillow
Running setup.py install for olefile ... error
Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build- KwQqVS/olefile/setup.py';exec(compile(getattr(tokenize, 'op
en', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" build_ext --disable-jpeg install --record /tmp/pip-eOHYKZ-record/install-record.txt --single-vers
ion-externally-managed --compile --user --prefix=:
usage: -c [global_opts] cmd1 [cmd1_opts] [cmd2 [cmd2_opts] ...]
or: -c --help [cmd1 cmd2 ...]
or: -c --help-commands
or: -c cmd --help
error: option --disable-jpeg not recognized
----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build- KwQqVS/olefile/setup.py';exec(compile(getattr(tokenize, 'open', open) (__file__).rea
d().replace('\r\n', '\n'), __file__, 'exec'))" build_ext --disable-jpeg install --record /tmp/pip-eOHYKZ-record/install-record.txt --single-version- externally-managed -
-compile --user --prefix=" failed with error code 1 in /tmp/pip-build- KwQqVS/olefile/
I had the same problem and I solved it.
The error came from Pilow.
First you should install Pillow seperately: (with sudo)
sudo pip install --upgrade pillow
Then you run again the command:
curl https://raw.githubusercontent.com/GoogleCloudPlatform/cloudml-samples/master/tools/setup_cloud_shell.sh | bash
Everything will be ok.
The fix has been pushed to Github, the new version did
pip install --user --upgrade pillow,
which doesn't have the '--disable-jpeg' option. It seems that the new version of Pillow fixed the issue mentioned in Fail during installation of Pillow (Python module) in Linux and removed the option.

Instaling pyodbc on linux

On RHEL trying to install pyodbc getting below error:
InstallationError: Command /usr/bin/python -c "import setuptools,
tokenize;file='/tmp/pip-build-q948yR/pyodbc/setup.py';exec(compile(getattr(tokenize,
'open', open)(file).read().replace('\r\n', '\n'), file,
'exec'))" install --record /tmp/pip-Fdkc1f-record/install-record.txt
--single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-q948yR/pyodbc
You need to install a pre-requisite package to built pyodbc. On RHEL:
sudo yum install unixODBC-devel
If you're connecting to SQL Server, don't forget FreeTDS:
sudo yum install freetds-devel
Good luck!

Resources