Spynner install issues - python

Running Mac OS Lion
I was trying to do some scraping with Mechanize but I was having massive issues with javascript. So, after some browsing I decided to try out Spynner. I've tried to download it with both pip and easy_install but I get the same error each time:
Command /usr/bin/python -c "import setuptools;__file__='/private/tmp/pip-build-root/autopy/setup.py';exec(compile(open(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-53vGzx-record/install-record.txt --single-version-externally-managed failed with error code 1 in /private/tmp/pip-build-root/autopy
Looking for some help (or maybe another suggestion rather than Spynner).
I have XCode installed and updated (along with command line tools).
I've made the links between gcc and gcc-4.2 (ln -s /usr/bin/gcc /usr/bin/gcc-4.21)
I have virtualenv installed. I only mention that because I've noticed that a lot of the same problems occur with its installation as well.

Related

Error: module' object has no attribute 'symlink

I am installing Ansible using Python2.7 but I am having an error upon installation.
Here are my steps and I am using Windows 10 64 bit
Install Python 2.7
Go to command line and go to directory C:\Python27\Scripts
Type command pip install ansible
Error
Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\dave\\appdata\\local\\temp\\pip-build-_tn3so\\ansible\\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\dave\appdata\local\temp\pip-ltscus-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\dave\appdata\local\temp\pip-build-_tn3so\ansible\
As is clearly stated in the fine manual, Windows is not supported for use as a control machine. Even if you got it to install, the next problem you'd have is trying to convince it to use a sane ssh client, of which PuTTY is not one.
I am sure you can use the Windows Subsystem for Linux to gain access to a reasonable operating system inside the unreasonable one

Installing scikit learn python package for Cloud9

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

How to fix netifaces module installation for python2.7?

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.

pip install igraph for python 3.4: compiler error

I want to install python-igraph for Python 3.4 on Mac OSX 10.10.
When I do
jenny$ pip3 install python-igraph
I get
checking whether the C compiler works... no
configure: error: in `/private/var/folders/q7/jc5nc2px3p1_sr6gnj7749wc0000gq/T/pip_build_jenny/python-igraph/tmp/igraph.p_05kabc/igraph-0.7.1':
configure: error: C compiler cannot create executables
See `config.log' for more details
Extracting igraph-0.7.1.tar.gz...
Configuring igraph...
Could not download and compile the C core of igraph.
----------------------------------------
Cleaning up...
Command /Library/Frameworks/Python.framework/Versions/3.4/bin/python3.4 -c "import setuptools, tokenize;__file__='/private/var/folders/q7/jc5nc2px3p1_sr6gnj7749wc0000gq/T/pip_build_jenny/python-igraph/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /var/folders/q7/jc5nc2px3p1_sr6gnj7749wc0000gq/T/pip-vudi0il0-record/install-record.txt --single-version-externally-managed --compile failed with error code 1 in /private/var/folders/q7/jc5nc2px3p1_sr6gnj7749wc0000gq/T/pip_build_jenny/python-igraph
I checked out this similar question, and the linked githib issue and then tried
pip3 install python-igraph --install-option="--c-core-version=0.7.1"
based on the information I found, with essentially the same error.
Based on the comments in that stackoverflow question, I also tried looking for the developer branch of python-igraph on github but I can't find it.
I'm a little lost. Can anyone tell me how to install this?
Do you have a c compiler installed?
How about Xcode Command Line Tools?
Try executing the following from your terminal:
xcode-select --install
And click the "Install" button on the pop-up window.
After it's installed, verify the Xcode Command Line Tools installation with:
gcc --version
Then try your pip3 installation again.

Python Pygame OSx error relating to El Capitan System

I'm installing PyGame on to OSx ElCapitan with a System install of 2.7 and Brew install of Python3 following this blog post. The brew install Python3 worked fine with
sudo pip3 install hg+http://bitbucket.org/pygame/pygame
But
sudo pip install hg+http://bitbucket.org/pygame/pygame
runs into the following error
running install_headers
creating /System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pygame
error: could not create '/System/Library/Frameworks/Python.framework/Versions/2.7/include/python2.7/pygame': Operation not permitted
Rolling back uninstall of pygame
Command "/usr/bin/python -c "import setuptools, tokenize;
__file__='/tmp/pip-wepMKN-build/setup.py';
exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))"
install --record /tmp/pip-sWpHWA-record/install-record.txt
--single-version-externally-managed --compile"
failed with error code 1 in /tmp/pip-wepMKN-build
which I believe is related to the new System Integrity Protection in El Capitan. Everything was updated and doctored before so the system is running well otherwise.
Any help on how I can overcome this would be awesome and helpful to many I'm sure.
Thanks
Chris
#Arthur has provided a link to a thread on the possible solutions to this problem although I'm not sure I'm ready to turn off the SIP so personally would opt for the user only install suggested by a not approved answer on the aforementioned thread.

Categories

Resources