Install tool from source on pythonanywhere - python

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.

Related

Lambda package includes pip, setuptools

I followed the AWS guide to prepare a deployment package for my lambda function. The generated zip file is around 9 - 10MB which includes pip, setuptools, pylint. Are they really required?
Here are the commands.
virtualenv v-env
source v-env/bin/activate
pip install xmltodict
pip install requests
deactivate
cd v-env/lib/python3.7/site-packages/
zip -r9 ../../../../function.zip .
Edit: Remove installing boto as it is provided by AWS already
Well, as you may see the guides provide standars and, obviously, guidance for a clean and nice coding or project deployment.
Pylint has a lot of features that help you out while using Python as your programming language, such as checking coding standars, error detection, refactoring help in order to prevend duplicated code, among other tools.
Setuptools is really useful too. Is a development process library designed to facilitate packaging Python projects by enhancing the Python standard library distribution utilities, I encourage you to use it in order to wrap your processes and models in order to have a strong modular project.
And pip is a Package Manager for python packages or modules. You can add, download, delete and a lot more things with it by simple using few words on a line of code. This package manager is useful, you can download wheels, zip's and modules from the internet and easily install them by just using
pip install <module or library name>
So, by answering your question, if you downloaded and installed a package for AWS supported in Python and it installed those libraries I must think those are being used across the modules you want to use.
You can always check the source code in order to be sure.
If the libraries aren't really being used, they aren't necessary since there are several libraries and packages that do what those libraries do.
Hope it helps, happy coding.

PyGObject on Windows

Over the last few days of headaches, I've found 3 possible methods to do this, all of which have issues.
PyGObject's pip install fails due to a lack of Cairo and probably other dependencies. While this would be my preferred method, it would probably be the hardest to fulfill.
Using MSYS2 allows me to use GObject through the mingw64 python, but using pip to get my other modulues such as pylint fails. I'd like to have an MSYS2 or similar install on my system anyways to make some windows binaries, so I'm very open to this as well.
EDIT: Got pip to work in MSYS2. Make sure to sync toolchain with pacman.
PyGObject for Windows seems messy at best and isn't up-to-date. Would require having a second python installation anyways, giving no benefit over MSYS2.
Note I'm a complete newbie to Unix and have little experience with CLI's in general, so any help regarding MSYS2 will need to be explained as if to a child. My only other experience with this stuff involved an endless cycle of hell that was installing Arch to a separate partition, breaking said install, then reinstalling again.
I also tried Cygwin, but I couldn't get that to run Python with GObject at all with my "install all the needed packages then pray" method. Creating a Gtk.Window() caused the terminal to use none of the memory it had and explode.
MSYS2 is currently the only "officially" supported way: https://pygobject.readthedocs.io/en/latest/getting_started.html#windows
pip in MSYS2 should work in general, if something doesn't please file a bug at https://github.com/Alexpux/MINGW-packages/issues .
As you said in the third alternative to install a new Python version, you can create and run multiple Python versions using pyenv. You can go through the installation section of their Github repo for installation and an overview: https://github.com/pyenv/pyenv/
For a comprehensive guide on how to use it, you read this amazing post by Real Python:
https://realpython.com/intro-to-pyenv/

Can't install mpi4py with OpenMPI: Cannot compile MPI programs

it's my first post here so apologies if my style is wrong!
I've been trying to install mpi4py (as SU2 requires it for parallel processing) on Ubuntu 16.04 using python 3.6. I downloaded mpi4py and tried to build from source as I would like to use the OpenMPI libraries I had configured, and tried the following:
sudo python setup.py build --mpicc=/opt/openmpi/openmpi-2.1.0/bin/mpicc
However, it ultimately fails with "error: Cannot link MPI programs. Check your configuration!!!"
Looking at the SU2 and mpi4py documentation, they recommend using pip instead. I also tried this:
sudo pip install mpi4py
and env MPICC=/opt/openmpi/openmpi-2.1.0/bin/mpicc pip install mpi4py but they also gave the same error.
I have saved both outputs - please see the link for the attachments. It seems to pick up on a lot of the files from my NVIDIA CUDA installation, though I'm not sure why.
I'm a beginner at at compiling programs so I'd appreciate it if anyone could shed any light on this? Thanks.
Though its an old post but I will post my answer might help others.
I fixed this problem by following commands:
sudo apt install libopenmpi-dev
pip install mpi4py`
For anyone else who is struggling with this problem, it turned out to be a number of factors. Mainly, mpi4py was not building correctly as my implementation of MPI (openMPI) had not been properly built. There were many factors that differentiated building programs on an existing supercomputer and a fresh Linux install.
Some troubleshooting tips I can recommend are:
Make sure you clear away any environmental variables which are unnecessary for the install using unset
Unload any modules which may interfere with the install using module unload. This is especially true when building your own MPI implementation on a supercomputer which has several others loaded already.
Check your $PATH variable for any locations which may contaminate your install (not forgetting that the order is important)! You may want to temporarily set a cleaner PATH variable to make sure the build picks up the correct libraries.
Hope this helps.

Using easy_install with sklearn-pandas

I am trying to install sklearn-pandas.
On my attempt:
easy_install sklearn-pandas
I get the result:
The package setup script has attempted to modify files on your system
that are not within the EasyInstall build area, and has been aborted.
This package cannot be safely installed by EasyInstall, and may not
support alternate installation locations even if you run its setup
script by hand. Please inform the package's author and the EasyInstall
maintainers to find out if a fix or workaround is available.
I'm on windows 7 (I admit it!), using Python 2.7.3
This is the first time I've gotten any error like this. Possible ideas I've explored are the more basic solutions:
The authors didn't write this package to be installed with easy_install
I have some sort of file permission problem (?)
There is some sort of dependencies issues
If anyone has ever gotten this error or has any insight into this please let me know! Much thanks.
Don't use easy_install, use pip!
(To install pip, follow this other StackOverflow question).
Additionally, you're probably going to need a compiler, development tools, and header files for Python (it's a whole 'nother bag of worms in Windows).
Assuming all is well, you can now
pip install sklearn-pandas

How to install django on jython (Windows 7)

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.

Categories

Resources