Scrapy installation fails when collecting Twisted / Centos 7 - python

So guys, I just made a fresh installation of Python 3.6 on Centos 7. Created a virtual environment, when I run pip install scrapy, it starts collecting few other dependencies, but fails when it comes to Twisted without returning any error at all. It just freezes and nothing ever happens.
Collecting Twisted>=13.1.0 (from scrapy)
Using cached Twisted-17.9.0.tar.bz2
I've been looking into this error since yesterday, looks like error could be related to Twisted's tar.bz2 extension. I'm new to linux environment and Python, have successfully installed Scrapy on Windows a few months ago using the same pip install scrapy method. But right now, I have no clue how to proceed.
That's the guide I followed to install Python on Centos7.
https://www.digitalocean.com/community/tutorials/how-to-install-python-3-and-set-up-a-local-programming-environment-on-centos-7
Could someone please point me in the right direction? Could it really be related to Twisted's compression method? If so, how can I find a way around this issue?
Huge thanks in advance.

Couldn't figure out how to get it extract bz2, so ended up installing Twisted and its dependencies manually. For future reference;
Download latest Twisted here
Extract the file
cd to twisted/src/Twisted.egg-info
Run pip install -r top_level.txt. This will install Twisted's dependencies.
python setup.py install
That's it. You can now run pip install scrapy.

Related

How to install Pillow 7.0.0 on Pycharm running Python 3.8?

I'm trying to use Django and displaying images from a Sql db, following this LinkedIn Learning tutorial.
In the process of running manage.py to run my django development server, I face an issue where I have to have pillow installed.
This process has so far proven tedious and here are the things I've tried:
Ran the "simple" python -m pip Pillow, python -m pip Pillow --upgrade in the PyCharm terminal, then get:
a required dependency when compiling Pillow from source.
Please see the install instructions at:
https://pillow.readthedocs.io/en/latest/installation.html
(Pycharm Ultimate, which I have): Running the WSL environment as provided in the release notes. This should to work as I have the required pre-reqs installed in WSL. However, my computer runs the dreaded "skeletons" process for quite a long time, and I don't see it ending anytime soon.
Attempting to install from the PyCharm GUI also fails in the same way as 1.
Attempting to install the following binaries from https://www.lfd.uci.edu/~gohlke/pythonlibs/#pillow which is referenced in some other answers for this topic gives me this error when installing via pip install <wheel name here>:
Pillow-7.0.0-cp38-cp38-win_amd64.whl is not a supported wheel on this platform.
**pip3 doesn't work either. Mentioning although in my PyCharm virtualenv they both point to the same python interpreter. At first glance...
My main ask is - has anyone been able to install pillow 7.0.0 on Windows 10, for a PyCharm virtualenv? And, if so, how have you done it? So I can get back to learning! Thank you in advance!
EDIT: Updated steps taken in (1). Sorry about that

How do I install a Python library? [duplicate]

I'm having a hard time setting up python packages. EasyInstall from SetupTools is supposed to help that, but they don't have an executable for Python 2.6.
For instance to install Mechanize, I'm just supposed to put the Mechanize folder in C:\Python24\Lib\site-packages according to INSTALL.txt, but runnning the tests does not work. Can someone help shed some light on this? Thanks!
The accepted answer is outdated. So first, pip is preferred over easy_install, (Why use pip over easy_install?). Then follow these steps to install pip on Windows, it's quite easy.
Install setuptools:
curl https://bootstrap.pypa.io/ez_setup.py | python
Install pip:
curl https://bootstrap.pypa.io/get-pip.py | python
Optionally, you can add the path to your environment so that you can use pip anywhere. It's somewhere like C:\Python33\Scripts.
Newer versions of Python for Windows come with the pip package manager. (source)
pip is already installed if you're using Python 2 >=2.7.9 or Python 3 >=3.4
Use that to install packages:
cd C:\Python\Scripts\
pip.exe install <package-name>
So in your case it'd be:
pip.exe install mechanize
This is a good tutorial on how to get easy_install on windows. The short answer: add C:\Python26\Scripts (or whatever python you have installed) to your PATH.
You don't need the executable for setuptools.
You can download the source code, unpack it, traverse to the downloaded directory and run python setup.py install in the command prompt
Starting with Python 2.7, pip is included by default. Simply download your desired package via
python -m pip install [package-name]
As I wrote elsewhere
Packaging in Python is dire. The root cause is that the language ships without a package manager.
Fortunately, there is one package manager for Python, called Pip. Pip is inspired by Ruby's Gem, but lacks some features. Ironically, Pip itself is complicated to install. Installation on the popular 64-bit Windows demands building and installing two packages from source. This is a big ask for anyone new to programming.
So the right thing to do is to install pip. However if you can't be bothered, Christoph Gohlke provides binaries for popular Python packages for all Windows platforms http://www.lfd.uci.edu/~gohlke/pythonlibs/
In fact, building some Python packages requires a C compiler (eg. mingw32) and library headers for the dependencies. This can be a nightmare on Windows, so remember the name Christoph Gohlke.
I had problems in installing packages on Windows. Found the solution. It works in Windows7+. Mainly anything with Windows Powershell should be able to make it work. This can help you get started with it.
Firstly, you'll need to add python installation to your PATH variable. This should help.
You need to download the package in zip format that you are trying to install and unzip it. If it is some odd zip format use 7Zip and it should be extracted.
Navigate to the directory extracted with setup.py using Windows Powershell (Use link for it if you have problems)
Run the command python setup.py install
That worked for me when nothing else was making any sense. I use Python 2.7 but the documentation suggests that same would work for Python 3.x also.
Upgrade the pip via command prompt ( Python Directory )
D:\Python 3.7.2>python -m pip install --upgrade pip
Now you can install the required Module
D:\Python 3.7.2>python -m pip install <<yourModuleName>>
pip is the package installer for python, update it first, then download what you need
python -m pip install --upgrade pip
Then:
python -m pip install <package_name>
You can also just download and run ez_setup.py, though the SetupTools documentation no longer suggests this. Worked fine for me as recently as 2 weeks ago.
PS D:\simcut> C:\Python27\Scripts\pip.exe install networkx
Collecting networkx
c:\python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py:318: SNIMissingWarning: An HTTPS reques
t has been made, but the SNI (Subject Name Indication) extension to TLS is not available on this platform. This may caus
e the server to present an incorrect TLS certificate, which can cause validation failures. You can upgrade to a newer ve
rsion of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#snimissi
ngwarning.
SNIMissingWarning
c:\python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py:122: InsecurePlatformWarning: A true SS
LContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL con
nections to fail. You can upgrade to a newer version of Python to solve this. For more information, see https://urllib3.
readthedocs.io/en/latest/security.html#insecureplatformwarning.
InsecurePlatformWarning
Downloading networkx-1.11-py2.py3-none-any.whl (1.3MB)
100% |################################| 1.3MB 664kB/s
Collecting decorator>=3.4.0 (from networkx)
Downloading decorator-4.0.11-py2.py3-none-any.whl
Installing collected packages: decorator, networkx
Successfully installed decorator-4.0.11 networkx-1.11
c:\python27\lib\site-packages\pip\_vendor\requests\packages\urllib3\util\ssl_.py:122: InsecurePlatformWarning: A true SSLContext object i
s not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. You can upgrade
to a newer version of Python to solve this. For more information, see https://urllib3.readthedocs.io/en/latest/security.html#insecureplat
formwarning.
InsecurePlatformWarning
Or just put the directory to your pip executable in your system path.
As mentioned by Blauhirn after 2.7 pip is preinstalled. If it is not working for you it might need to be added to path.
However if you run Windows 10 you no longer have to open a terminal to install a module. The same goes for opening Python as well.
You can type directly into the search menu pip install mechanize, select command and it will install:
If anything goes wrong however it may close before you can read the error but still it's a useful shortcut.

Python 2.7 easy_install - the process cannot access the file because it is being used by another process error

Using Python I am trying to install a library called yappi through easy_install. However I am getting this error below on Windows 7 Command Shell:
I explored alternative installations. I tried previously 'pip install yappi' but this didn't work due to a separate error (can't build wheel) which is a separate question.
Try downloading the appropriate wheel from here.
Then use pip install [package].

Installing packages using pip give SSL error

I recently started learning Python, am new to Python but not to programming. I have four machines on which I was able to install the Django and Python seamlessly. On the fifth machine that is a Mac Book Pro OS 10.6.8 I am able to install Django (or for that matter any other package) for Python2.6 but get the following error if I try it for Python 3.4.1
Downloading/unpacking django
Cannot fetch index base URL https://pypi.python.org/simple/
Could not find any downloads that satisfy the requirement django
Cleaning up...
No distributions at all found for django
Storing debug log for failure in /Users/himmy/.pip/pip.log
I tried searching the web and the closest I found was
Can't Install `pip` for `python 3.3` but worked fine for `python 2.7`
which doesn't really solve the problem.
Thanks in Advance
Per a comment by the OP:
Downgrading pip to version 1.2 solves the problem. The easiest way to
achieve this is:
curl -O pypi.python.org/packages/source/p/pip/pip-1.2.1.tar.gz tar xvfz pip-1.2.1.tar.gz cd pip-1.2.1 python setup.py install

Kivy with suds - module installation

I am pretty new to python, my background is with VB visual studios, I am trying to develop a app in which I want to consume WCF service. Found Suds is the required python module.
I am using Kivy 1.8.0 and Eclipse with pydev on Windows 7 64bit. Could you please point me in correct direction on how to instal the package, found no exe, I have run the setup.py from suds but did not work.
Any advice/direction towards tutorial is of great help.
Are you by any chance running the Python 3 version of Kivy? Suds looks like it is abandondonware (last release in 2010) and likely does not have a Python3 port. You may have luck with the Python2.7 version of Kivy and pip installing suds, but keep in mind you will be relying on an apparently unsupported module (suds) for your project.
The best tool to install Python modules is pip.
With pip you don't even need to download installed module because it get it from remote repository.
pip search suds
pip install suds
Maybe you have pip installed with Python.
Otherwise see page https://pypi.python.org/pypi/pip
BTW: Of couser not all modules are available by pip but this way you can get most modules.
EDIT:
Installion suds with pip looks (on Linux) like this:
$ pip install suds
Downloading/unpacking suds
Downloading suds-0.4.tar.gz (104kB): 104kB downloaded
Running setup.py egg_info for package suds
Installing collected packages: suds
Running setup.py install for suds
/usr/bin/python -O /tmp/tmp5qxEid.py
removing /tmp/tmp5qxEid.py
Successfully installed suds
Cleaning up...

Categories

Resources