Installing requirements.txt - python

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.

Related

How can I get the python xmlsec library running on Pivotal Cloud Foundry

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

Django channels install failure in Windows 10

Here is the environment:
OS:windows 10
Django:2.0rc
Python:3.6
pip:10.0.0
visual studio community 2017
And the error message:
running build_ext
building 'twisted.test.raiser' extension
error: Microsoft Visual C++ 14.0 is required. Get it with "Microsoft Visual
C++ Build Tools": http://landinghub.visualstudio.com/visual-cpp-build-tools
Command "c:\users\airy\appdata\local\programs\python\python36\python.exe -u -c "import setuptools,
tokenize;__file__='C:\\Users\\Airy\\AppData\\Local\\Temp\\pip-install-0a1gjuaj\\twisted\\
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\Airy\AppData\Local\Temp
\pip-record-k1vjz5aa\install-record.txt --single-version-externally-managed
--compile" failed with error code 1 in C:\Users\Airy\AppData\Local\Temp\pip-install-0a1gjuaj\twisted\
I have already installed the build tools following the link description but it still doesn't work. If someone has solved it, please tell me how to fixed it.
Download twisted from this link.
Downloading Twisted‑18.4.0‑cp36‑cp36m‑win32.whl worked for me because I'm using Python 3.6. Download the version according to the python that you use.
After you download Twisted from the given link, open up a cmd where the file is located and run pip install Twisted‑18.4.0‑cp36‑cp36m‑win32.whl. pip will install Twisted from this file.
If you're doing it in a virtualenv, activate the virtualenv and install Twisted after that in the same process.
After that, you'll be able to install channels or whatever.
if you followed the instructions as mention by #rahim.nagori and encounter the problem as mention by #DiptangsuGoswami. just download the 32bit version of twisted or 64bit (if what you used previously was 32bit). it worked for me!

Error while installing mysqlclient for python in Windows 10

I use this command for installing MySQL client:
pip install mysqlclient
And then I see this problem:
running build_ext
building '_mysql' extension
error: Microsoft Visual C++ 10.0 is required. Get it with "Microsoft Windows SDK 7.1": www.microsoft.com/download/details.aspx?id=8279
Cleaning up... Command C:\Python34\python.exe -c "import setuptools,
tokenize;file='C:\Users\Jayed\AppData\Local\Temp\pip_build_Jayed\mysqlclient\setup.py';exec(compile(getattr(tokenize,
'open', open)(file).read().replace('\r\n', '\n'), file,
'exec'))" install --record
C:\Users\Jayed\AppData\Local\Temp\pip-l4c6dhkk-record\install-record.txt
--single-version-externally-managed --compile failed with error code 1 in C:\Users\Jayed\AppData\Local\Temp\pip_build_Jayed\mysqlclient
Storing debug log for failure in C:\Users\Jayed\pip\pip.log
Actually I went down this path. While I suppose you can find all the libraries and components you need to get the client to compile, it is telling you it can't find a compiled copy of the client and is trying to compile it to install it.
Follow the instructions here: https://pypi.org/project/mysqlclient/ (it has notes about windows doing what you are describing) or download the wheel file (from downloads link on the page) and type
pip install mysqlclient.whl
and it will install without demanding C++ in order to use mysql with python.

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.

Unable to install pyodbc

I am using python 3.3.0 .. Within this package C:\Python34\Scripts is my pip and I have added this path to my system and user environment variable PATH the link to this pip folder,I have installed Visual C++ 2010 but i don't know what needs to be done once it is installed if or not i need to configure something, yet when I do :
C:\Python33\Scripts>pip install https://pyodbc.googlecode.com/files/pyodbc-3.0.7.zip
It gives me the following error:
This is what stackoverflow editor has changed it to :
Fatal error in launcher: Unable to create process using
'"C:\Python33\python.exe " "C:\Python33\Scripts\pip.exe" install
https://pyodbc.googlecode.com/files/pyo dbc-3.0.7.zip'
C:\Python33\Scripts>pip
Fatal error in launcher: Unable to create process using
'"C:\Python33\python.exe " "C:\Python33\Scripts\pip.exe" '
And this is the actual error that i see at console:
ValueError: ['path']
----------------------------------------
Command "C:\Python33\python.EXE -c "import setuptools, tokenize;__file__='c
\users\elyon\appdata\local\temp\pip-inh3nq-build\setup.py';exec(compi
e(getattr(tokenize, 'open', open)(file).read().replace('\r\n',
'\n'), __fil
__, 'exec'))" install --record c:\users\elyon\appdata\local\temp\pip-x45j1j-
ecord\install-record.txt --single-version-externally-managed
--compile" failed ith error code 1 in c:\users\elyon\appdata\local\temp\pip-inh3nq-build
Since you're on Windows with Python 3.3, the easiest way to install pyodbc is to use the provided installers.
You should then be able to manage future upgrades using pip if you so desire.
C:\Python33\Scripts> .\pip.exe install --upgrade --allow-external pyodbc --allow-unverified pyodbc pyodbc
Requirement already up-to-date: pyodbc in c:\python33\lib\site-packages

Categories

Resources