I have tried using the jython setup.py install on my computer and its not working.
And how to install ez_setup.py on jython or is there another way to setup django on jython
Thank you in advance.
This tutorial shows you how to install it. Ideally everything boils down to two points:
First you need to get pip, here is a good tutorial on how that is done. If you don't want to read that, you can simply download pip from here. After that, you will need to extract it, I suggest 7-zip. After that, you can go into the directory and find setup.py. Run setup.py like jython setup.py install -> this might be different.
After that, you can do something like pip install django, and it should work if jython is your own python interpreter. Otherwise, you are going to have to go into your jython directory, then go into a directory called scripts. Then run pip.exe install django if you're running on windows.
Please note, that my advice is from that of a Windows user, so your experience might be different, and probably a lot more pleasant.
Related
I am trying to use Pythonanywhere to run some of my scripts. Eventually I would like to turn the entire code into a webapp, but I am not there yet.
Anyway, I would like to install a couple of bioinformatics packages on Pythonanywhere. Biopython has wrappers for these tools, but you still need the actual tools instaled. The tools in question do not have pip or easyinstall compatibility. So I think I will have to download/compile from source? However, I keep on running into "no permission" issues. Would a virtualenv be a solution?
As always, any help is greatly appreciated
Virtualenv works for Python packages.
However if you're trying to use non Python packages/libraries it won't be of much use.
Since the tools don't have easyinstall or pip compatibility I don't think using virtualenv will work out.
Download and compile from source should work though.
Note that if Biopython is installable via easyinstall or pip then use virtualenv to get that.
Did anybody manage to install pypotrace or is able to install mingwin it's like mission impossible for me I've passed the last 12 hours trying to found out how but nothing is working and description are poor please could any body help? This is where you can get it:
pypotrace web site
This problem was so much of a pain that I ported potrace to python directly rather than using hooks and requiring local compile.
pip install potracer
https://github.com/tatarize/potrace
I implemented the same API as pypotrace so it should be fairly painless.
Since you are working in windows you need the following steps:
You may need the python distutils package - pip install -U distuilts should do the job.
You will also need Cython - the windows installers are here.
You need to install mingw and make sure it is working in
msys mode - run msys and you should get a command prompt in it type
gcc --version and make sure you get a sensible reply.
also make sure your python runs from within msys
Do the required downloads:
potrace source,
agg source site broken or the GitHub zip file here,
potrace source from here and unzip it.
The follow the instructions at the link you gave and tell us where they stop working.
Two options in setup.py develop and install are confusing me. According to this site, using develop creates a special link to site-packages directory.
People have suggested that I use python setup.py install for a fresh installation and python setup.py develop after any changes have been made to the setup file.
Can anyone shed some light on the usage of these commands?
python setup.py install is used to install (typically third party) packages that you're not going to develop/modify/debug yourself.
For your own stuff, you want to first install your package and then be able to frequently edit the code without having to re-install the package every time — and that is exactly what python setup.py develop does: it installs the package (typically just a source folder) in a way that allows you to conveniently edit your code after it’s installed to the (virtual) environment, and have the changes take effect immediately.
Note: It is highly recommended to use pip install . (regular install) and pip install -e . (developer install) to install packages, as invoking setup.py directly will do the wrong things for many dependencies, such as pull prereleases and incompatible package versions, or make the package hard to uninstall with pip.
Update:
The develop counterpart for the latest python -m build approach is as follows (as per):
From the documentation. The develop will not install the package but it will create a .egg-link in the deployment directory back to the project source code directory.
So it's like installing but instead of copying to the site-packages it adds a symbolic link (the .egg-link acts as a multiplatform symbolic link).
That way you can edit the source code and see the changes directly without having to reinstall every time that you make a little change. This is useful when you are the developer of that project hence the name develop. If you are just installing someone else's package you should use install
Another thing that people may find useful when using the develop method is the --user option to install without sudo. Ex:
python setup.py develop --user
instead of
sudo python setup.py develop
I am not a total newbie but I am trying to install modules for quite a long time and at this point i would like to have a fresh start and install python and all the modules I need so i really understand them. My problem is that some of them import, but most of them install either to the wrong site-packages or dont import maybe because i messed up my system/python. Also I tried the PYTHONPATH and PATH to set this up right, but it never worked.
So my questions are:
Is there a way to ensure I can clean everything up and start from zero ?
Ideally this would be without having to set up Mac OSX new.
Is there a way to install all the modules in the correct place (whatever the directory is I dont care, it should just work)?
Is there a good step-by-step description on how installing modules works. And I dont mean just the info to use easy_install, pip install etc, but a way to fully understand what I need to consider, where I need to put them, why these modules are recognized in certain directories, how the system finds them and most important what are the most common pitfalls and how to avoid them.
I also tried Macports and various other similiar ways to install but even if some of them worked and while I am sure that these are really great tools, most I had to hack to work.
So if someone can recommend a good and stable way to install a lot of modules at once, this would be incredibly useful.
Thanks a lot !!!!
And sorry for the long questions.
Buildout and virtualenv should be what you are looking for.
Buildout helps you configure a python installation and virtualenv allows you to isolate multiple different configurations from each other.
Here's a nice blog post explaining how to use them together.
Also, see this other question: Buildout and Virtualenv
You can safely install an up-to-date Python 2 and/or Python 3 on OS X using the python.org installers here. They will coexist with any other Pythons you have installed or that were shipped by Apple with OS X. To install packages, for each Python instance first install Distribute which will install a version-specific easy_install command, i.e. easy_install-2.7 or easy_install-3.2. Many people prefer to use pip to manage packages; you can use easy_install to install a version-specific copy of it. If you want something fancier, you could also install virtualenv but, with the isolation provided by Python framework builds on OS X, that isn't as necessary as on most other platforms.
Is there a way to install all the modules in the correct place?
Download and untar/gunzip/etc the module source (Most of the modules ares available in gzip form at http://pypi.python.org/pypi), then run configure with --prefix set to the same thing for every install:
[ 11:06 jon#hozbox.com ~ ]$ ./configure --prefix=/usr/local
/usr/local is usually the default, but it doesn't hurt to specify it and will ensure that every module you install will be placed in /usr/local/lib/python/...
Is there a good step-by-step description on how installing modules works?
The Python website has a great page called: Installing Python Modules
http://pypi.python.org/pypi
http://docs.python.org/install/index.html
I'm just learning the art of writing a setup.py file for my project. I see there's lots of talk about setuptools, which is supposed to be superior to distutils. There's one thing though that I fail to understand, and I didn't see it addressed in any tutorial I've read about this: What if setuptools isn't installed? I understand it's not part of the standard library, so how can you assume the person who wants to install your program will have it installed?
The standard way to distribute packages with setuptools includes an ez_setup.py script which will automatically download and install setuptools itself - on Windows I believe it will actually install an executable for easy_install. You can get this from the standard setuptools/easy_install distribution.
In most librarys I ever installed for python, a warning apears "You have to install setuptools". You could do it as well I think, you could add a link so the user don't have to search the internet for it.
I have used setuptools to compile many python scripts that I have written into windows EXEs. However, it has always been my understanding (from experience) that the computer running the compiled EXE does not need to have setup tools installed.
Hope that helps
You can't assume it's installed. There are ways around that, you can fall back to distutils (but then why have setuptools in the first place) or you can install setuptools in setup.py (but I think that's evil).
Use setuptools only if you need it.
When it comes to setuptools vs distrubute, they are compatible, and choosing one over the other is mainly up to the user. The setup.py is identical.
I would say it depends on what kind of user you are addressing.
If they are simply users and not Python programmers, or if they are basic programmers, using setuptools might be a little bit too much at first. For those the distutils is perfect.
For clients, I would definitely stick to distutils.
For more enthusiast programmers the setuptools would be fine.
Somehow, it also depends on how you want to distribute updates, and how often. For example, do the users have an access to the Internet without a nasty proxy setup by their company that would block setuptools? - We do have one and it's an extra step to configure and make it work on every workstation.
You can download Windows EXE installers and a Linux RPM from here
http://pypi.python.org/pypi/setuptools
Then, once you have setuptools in place you can use the easy_install command to both download and install new packages. Because easy_install, also automatically downloads and installs dependencies, you might want to set up virtualenv before you actually use it. That way you can decide whether or not you want to install a bunch of packages into your system's default Python install.
Yes, this means that your users will have to have setuptools installed in order for them to use it. Of course, you could take the setuptools installers, rename them, and package them up with like NSIS and distribute that to your users. The fact is, that you have to install something, so if you don't want to put your application in the installer, you can package up setuptools instead.