trying to install uWSGI from the command line
pip install uwsgi
results in a long stack trace, here is the end of it:
/usr/bin/x86_64-linux-gnu-ld: /usr/local/lib/python3.6/config-3.6m-x86_64-linux-gnu/libpython3.6m.a(parser.o):
relocation R_X86_64_32 against `.rodata.str1.8' can not be used when making a PIE object;
recompile with -fPIC
/usr/bin/x86_64-linux-gnu-ld: final link failed: Nonrepresentable section on output
collect2: error: ld returned 1 exit status
*** error linking uWSGI ***
----------------------------------------
Command "/home/user/venv/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-install-ve0nx9k8/uwsgi/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-record-l_7f937a/install-record.txt --single-version-externally-managed --compile --install-headers /home/user/venv/include/site/python3.6/uwsgi" failed with error code 1 in /tmp/pip-install-ve0nx9k8/uwsgi/
I'm using Python 3.6. Python 2 works and Python 3.7 works, but unfortunately I need to use Python 3.6. There is nothing else in the virtual environment, and this is a pretty new reinstall of ubuntu.
The error means that the linker wants to build a Position Independent Executable (PIE object), but it can't because the library libpython3.6m.a was built without the support of this kind of linking.
I faced this issue when using Python installed via pyenv.
To fix the issue in this case, reinstall Python with special compiler flags:
CONFIGURE_OPTS=--enable-shared pyenv install 3.7.7 # use your Python version
This is mentioned in their wiki, but for me, it was unclear when such flag is required.
I had this error trying to build with the system python. When I switched to pyenv and installed a custom python version uWSGI installed fine.
Related
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
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!
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.
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.
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.