Just wanted to learn more about the scikit-learn package for Python, whilst learning about ML in an online course I'm doing. I'm currently using the Cloud9 online ide as I'm using a chromebook.
However, when I try to install the scikit-learn package for my ide, the access is always denied. I tried the following piece of code ...
pip install -U scikit-learn
And, I got this response ..
running install_lib
creating /usr/local/lib/python2.7/dist-packages/sklearn
error: could not create '/usr/local/lib/python2.7/dist-packages/sklearn': Permission denied
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip_build_ubuntu/scikit- learn/setup.py';exec(compile(getattr(tokenize, 'open', open) (__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-Oo3fnX-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip_build_ubuntu/scikit-learn
Does anyone have any experience in installing the sklearn package for the Cloud9 IDE? It's mentioned using the pythonpath and this is what it currently contains ...
/usr/local/lib/python2.7/dist-packages:/usr/local/lib/python3.4/dist-packages:/usr/local/lib/python3.5/dist-packages
If anyone has any clues / tutorials I can follow to get this installed, I would really appreciate the help!
The problem is not related to scikit-learn or python.
you need to use sudo before your pip command, like so:
sudo pip install -U scikit-learn
Related
I am trying to install vowpalwabbit by using pip in Windows.
My python version is 3.7. As I am new in using vowpalwabbit, it is possible that I forget to configure some external dependencies. Therefore, can you please explain every single the step to make it work. I got the following error when I run the following:
pip install vowpalwabbit
raise Exception('Pre-built vw/python library for Windows is not supported for this python version')
Exception: Pre-built vw/python library for Windows is not supported for this python version```
----------------------------------------
Command "C:\Users\I516\Documents\Newsfeed\venv\Scripts\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\I336\\AppData\\Local\\Temp\\pip-install-3tgy0rvf\\vowpalw
abbit\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record C:\Users\I336\AppDa
ta\Local\Temp\pip-record-o5qdntld\install-record.txt --single-version-externally-managed --compile --install-headers C:\Users\I336\Documents\Newsfeed\venv\include\site\python3.7\vowp
alwabbit" failed with error code 1 in C:\Users\I336\AppData\Local\Temp\pip-install-3tgy0rvf\vowpalwabbit\```
A new version of vowpalwabbit (8.7.0) was released to PyPI last week. In addition, binary wheels for 64-bit Python 3.6/3.7 are available for Windows.
If you're using the 64-bit version of Python (or can switch to using it):
pip install vowpalwabbit
should work properly without any additional dependencies
I have conda 4.5.11 installed in my machine and Python 3.7.0 and I am trying to install scikit-learn 0.19 using the following procedure:
pip uninstall scikit-learn
pip install scikit-learn==0.19
but I get the following errors:
Failed building wheel for scikit-learn
Command "/anaconda3/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/x5/t6zy26vd4gq36xgq6yl45p2h0000gn/T/pip-install-7h06grkn/scikit-learn/setup.py';f=getattr(tokenize, 'open', open)(file);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, file, 'exec'))" install --record /private/var/folders/x5/t6zy26vd4gq36xgq6yl45p2h0000gn/T/pip-record-eem8zdll/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/x5/t6zy26vd4gq36xgq6yl45p2h0000gn/T/pip-install-7h06grkn/scikit-learn/
and a bunch of warnings too. How can I use an older version of sklearn with an anaconda installation of python?
conda install scikit-learn==0.19 worked.
I had a similar issue, needed scikit-learn==0.18.1. What worked for me was uninstalling the current Conda, going to https://repo.anaconda.com/archive/ and finding the version that I needed.
For reference, the one that worked for me was: Anaconda3-4.3.1-Windows-x86_64.exe from March 2017.
After that, restart the IDE, and all dependencies were on the version I needed.
I'm in the process of trying to get the python module python3-saml working on a cloud foundry app that is using the standard python buildpack and cflinuxfs2 stack. This module relies on the python xmlsec module as a dependency, but I'm unfortunately running into issues with getting it working.
I've put together a requirements file and have vendored all of the python dependencies, but I keep getting the following error when I go to run the "cf push" command.
Running setup.py install for xmlsec: started
Running setup.py install for xmlsec: finished with status 'error'
Complete output from command /tmp/contents998689849/deps/0/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-lwwtrplp/xmlsec/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-qwoda574-record/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
*********************************************************************************
Could not find xmlsec1 config. Are libxmlsec1-dev and pkg-config installed?
*********************************************************************************
----------------------------------------
Command "/tmp/contents998689849/deps/0/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-lwwtrplp/xmlsec/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-qwoda574-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-lwwtrplp/xmlsec/
pip install has failed. You have a vendor directory, it must contain all of your dependencies.
**ERROR** Could not install pip packages: Couldn't run pip: exit status 1
Failed to compile droplet: Failed to run all supply scripts: exit status 14
Exit status 223
I tried uploading the appropriate libxmlsec1-dev and libxmlsec1 manually and set an environment variable to refer to them, but the staging process appears to just ignore those while it's setting up packages.
Is there anything that I could do to get this process working? I'd imagine there's a custom buildpack out there somewhere that would do the trick, but I wasn't sure if there was a way to do this using the standard python buildpack instead.
The primary option would be to vendor your dependencies. With this option, you build locally and then push all the compiled bits too. The trick is that you have to build on a compatible system, so you need an Ubuntu Trusty PC/VM/Docker container.
Follow these instructions, then run cf push & make sure that you do not have the vendor directory ignored (remove from .cfignore, if it exists).
https://docs.cloudfoundry.org/buildpacks/python/index.html#vendoring
The other option that should work is to use multi-buildpack support. With this you can push using two buildpacks. The first would be the Apt buildpack and the second would be the python buildpack. The Apt buildpack allows you to install the packages that you need, which looks like libxmlsec1-dev. The second is just the standard Python buildpack, but it will have access to what has been installed via the Apt buildpack.
You can see instructions here: https://docs.cloudfoundry.org/buildpacks/use-multiple-buildpacks.html
I am new to the Wagtail cms and am taking over a friend's project for his site.
I have downloaded his repo and am trying to get it to run locally. I have followed the steps on the wagtail documentation http://docs.wagtail.io/en/v1.12.1/getting_started/index.html
but in the site's requirements.txt file, there are some dependencies that just are not installing and giving errors:
here is the output of when trying to install the requirements:
build\lib.win32-2.7\psycopg2\_psycopg.pyd : fatal error LNK1120: 62 unresolved externals
error: command 'C:\\Users\\Adam\\AppData\\Local\\Programs\\Common\\Microsoft\\Visual C++ for Python\\9.0\\VC\\Bin\\link.exe' failed with exit status 1120
Rolling back uninstall of psycopg2
Command "c:\python27\python.exe -u -c "import setuptools,
tokenize;__file__='c:\\users\\Adam\\appdata\\local\\temp\\pip-build-
bykm5e\\psycopg2\\setup.py';f=getattr(tokenize, 'open', open)
(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code,
__file__, 'exec'))" install --record c:\users\Adam\appdata\local\temp\pip-
cidizd-record\install-record.txt --single-version-externally-managed --
compile" failed with error code 1 in c:\users\Adam\appdata\local\temp\pip-
build-bykm5e\psycopg2\
(The full output is here: https://pastebin.com/m1ukkei8)
Any help would be greatly appreciated - I am using Python 2.7 and have tried reinstalling psycopg and have installed postresql
Your windows linker is throwing out errors as you don't have c++ libraries for an extension to be built properly.
I would suggest to you to rather install it through wheel file
by running
pip install some-package.whl
I'm not sure if this is the answer, but the version of psycopg2 that you're using had a bug that prevented installation using pip, due to some bug in pip. Try version 2.5.3 and see if that fixes it.
Environment : Kali Linux 2
I started reading this book "Python network programming cookbook" and the writers listed few modules I am gonna need during the book i was able to install all of them except #netifaces, I tried both the "pip install netifaces" and "python setup.py install" methods but both made appear this message:
x86_64-linux-gnu-gcc: error trying to exec 'cc1': execvp: No such file or directory
error: command 'x86_64-linux-gnu-gcc' failed with exit status 1
----------------------------------------
Cleaning up...
Command /usr/bin/python -c "import setuptools, tokenize;__file__='/tmp/pip-build-lsf_5N/netifaces/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-TsHwUh-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /tmp/pip-build-lsf_5N/netifaces
Storing debug log for failure in /root/.pip/pip.log
I tried to install python-dev and all the libraries I could find in previous asked questions here but nothing made it happen
Thank you all for your help
It looks like you are missing gcc, which is needed to compile netifaces.
I've never used Kali Linux before but you should have apt so, you can try: sudo apt-get install gcc to install the missing package.
Hopefully this solves your problem.