Kivy with suds - module installation - python

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...

Related

in virtualenv, pip installing locally from source fails

I am trying to install a library in a virtualenv instance with pip. The library version I want (wxPython 3.0.2)
is not available on PyPi; it is only available for download from SourceForge. Thus, I have the source tarball downloaded on my machine and I am trying to install it in such a way that it will play nicely with virtualenv.
(I am on a Windows computer, running Python 2.7.)
I have tried the following:
doing a direct install: pip install wxPython-src-3.0.2.0.tar.bz2
extracting the files from the tarball to wxPython-src-3.0.2.0, then installing from the extracted directory: pip install wxPython-src-3.0.2.0
extracting the files from the tarball, then navigating into the extracted folder to the nested wxPython directory, which holds the setup.py file, and then installing from there: pip install wxPython
The last attempt seems the most promising, but I get the following traceback:
Processing \wxpython-src-3.0.2.0\wxpython
Complete output from command python setup.py egg_info:
Setuptools must be installed to build an egg
----------------------------------------
Command "python setup.py egg_info" failed with error code 1 in c:\users\__MY_USERNAME__\appdata\local\temp\pip-req-build-q0pxlt\
This is also strange, because it suggests I don't have setuptools even though I can run pip list and see version 40.6.3 installed.
Any help appreciated.
Why not install a precompiled version? There are a lot of .exe files at SF. You probably need wxPython3.0-win64-3.0.2.0-py27.exe.
Also take a look at Christoph Gohlke's collection.
If you still insist on installing from sources please bear in mind that wxPython 3 is so old it predates pip. Forget about pip.
First, you need to install wxWidgets as wxPython is just a Python wrapper for wxWidgets C++ library. Extract wxPython-src-3.0.2.0.tar.bz2 and follow instructions in wxPython-src-3.0.2.0/docs/msw/install.txt.
After compiling and installing wxWidgets compile wxPython. See wxPython-src-3.0.2.0/wxPython/docs/BUILD.txt.
My eventual solution was the easy way out: installing my package (wxPython) locally as #phd suggested, and opting for local package access via either virtualenv --system-site-packages env or deleting the "no-global-site-packages.txt" file in an existing environment folder.
Not what I expected to do, but it works so no complaints.

Scrapy installation fails when collecting Twisted / Centos 7

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.

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.

Installing PyCURL to a particular version of Python

I have Python 2.4 and 2.7 on my Centos server.
I would like to use PyCURL under Python 2.7.
I ran yum install pycurl and it appeared to install but when I attempt to import PyCURL it works fine for Python 2.4 but not for 2.7.
Can anyone advise how it is possible to install PyCURL (or any other Python extension for that matter as I can see this being an issue in future) to a specific version of python.
Thanks
C
------ SOULTION (thanks gjallar) ----------
Instead of using YUM I downloaded and installed PyCurl by running the setup.py file using the python version I wanted i.e.
sudo python2.7 setup.py install
This still didn't work as I was getting an error saying I had the wrong version of libcurl
To ressolve this I downloaded the latest curl version from http://curl.haxx.se/download.html and installed with the instructions here: http://curl.haxx.se/docs/install.html
Sadly, this still didn't work as when I tried to import pycurl in python I got:
File "<stdin>", line 1, in <module>
ImportError: libcurl.so.4: cannot open shared object file: No such file or directory
This was in turn ressolved by carrying out the command:
export LD_LIBRARY_PATH=/usr/local/lib
As suggested in the post:
Why can't Python find shared objects that are in directories in sys.path?
(Thanks Vinay)
Now it works.
One possible route you can take to install a certain application for a specific python version is to install pip using the specific python version and the use pip to install pyCURL.
In your case this should work by installing pip using python2.7 and then run pip install pycurl:
Install pip via distribute running the setup.py file with your python2.7 interpreter.
This requires pycurl to be available in PyPi - otherwise (if the pycurl download contains a setup.py) simple run the setup.py file using the interpreter you want to install it for.

dependency resolution pip virtualenv

I have 2 local libraries which are dependent on different version of suds.
Example -
Module-A-1.0's setup.py has a requirement of suds ==0.3.9.
Module-B-1.0's setup.py has a requirement of suds ==0.4.0.
Both these modules are required by Module-C, which has the following its setup.py
django
Module-A-1.0
Module-B-1.0
Module-C will be installed in a virtualenv using pip. My question is which version of suds will be installed and can I have both versions installed in the same virtual env?
What I noticed was, whichever module I specified first in the setup.py for Module-C, that version of suds gets installed. So in this case suds 0.3.9. If I switched the modules to
django
Module-B-1.0
Module-A-1.0
The version of suds that gets installed in suds-0.4.0.
Using pip + virtualenv you can't have two versions of a library installed at the same time.
And, unfortunately, I don't know of any good ways of handling this situation. Sorry.

Categories

Resources