Installing scikits.bvp_solver - python

I need to use scikits.bvp_solver in python.
I currently use Canopy as my standard Python interface, where this package isn't available. Is there another available package for solving boundary value problems? I have also tried downloading using macports but the procedure sticks when it tries building gcc48 dependency.

You can try to download the package tar.gz and use easy_install . Or you can unpack the package and use the standard way of python setup.py install. I believe both ways require a fortran compiler.

Related

Ways of installing python module

I'm new to python, about a month.
I know installing python modules can be done by using pip or easy_install. But when I was trying to install the regex module it gave me an error.
Typing pip install re in cmd gave me the following errors;
ERROR: Could not find a version that satisfies the requirement re (from versions: none)
ERROR: No matching distribution found for re
So I went to PyPI and downloaded a file there and now PyCharm doesn't give error when I import the module anymore.
So are there any difference between these ways of downloading Python modules or it doesn't matter ?
I'm using Windows 10 and have Python 3.8 and 3.8.1.
re is a built-in module, therefore you are not required to install this with pip.
Python Built-In Modules
re is part of the Python standard library so there is no need to install it separately. There are many ways to 'install' a package, e.g. using easy_install, pipx, venv, poetry, etc., but pip install --user is likely the way you're going to want to go to get started until you run into a compelling reason to explore other options. Either way, all these tools are essentially just various ways to move packages into PYTHONPATH, the place that Python looks for packages by default.

Installing Matplotlib on Windows ERROR - cannot open include file 'ft2build.h'

I am trying to install matplotlib using:
pip install matplotlib
However, I keep getting this error:
- cannot open include file 'ft2build.h' no such file or directory
Error Image
You are using python 3.8 for which no pre-built whl files are avialable on pypi, therefore your pip is attempting to build matplotlib from source. For this, you need to have downloaded and installed the dependencies of matplotlib. In this case, ft2build.h is missing which is part of the freetype library.
If you really want to build from source, there is a script based solution from the matplotlib developers to download and install all neccessary dependencies.
Since you probably don't care about building from source (which can be quite some work on Windows), you should instead consider one of these options:
Install a python version other than 3.8, it is very new and therefore there is not always an official pre-built whl file for modules you want to use
As MrFuppes suggested, download matplotlib‑3.2.0rc1‑cp38‑cp38‑win_amd64.whl from this unofficial collection of whl files and do pip install matplotlib‑3.2.0rc1‑cp38‑cp38‑win_amd64.whl in your cmd
It is a bit unclear what your problem is. It may just be that you have some packages that are not compatible. To avoid this sort of issue I can recommend the use of Anaconda: https://www.anaconda.com/
It will come with python and most basic libraries, including matplotlib. I can also recommend seaborn for professional-looking plots that do not require much code.

Python Installing Cython & Numba but no vcvarsall.bat despite Visual C++ 2010

I use Python 3.4
I try to install Cython and Numba but keep getting "Unable to find vcvarsall.bat".
I googled for the solution and found that I need Microsoft Visual C++ 2010 installed (for Python 3.4).
So I installed it.
And tried installing Cython and Numba ---> fail.
And then they say I must type "SET VS90COMNTOOLS=%VS100COMNTOOLS%" in the command prompt, which I did, like C:\Users\Dorky>set vs90comntools=%vs100comntools%.
And tried installing Cython and Numba again ---> fail.
Not enough with that, I also went to the environment variables to set this VS90 to VS100 thing manually.
And tried installing Cython and Numba again ---> fail.
So how exactly can I solve this special "Unable to find vcvarsall.bat" problem?
What the heck is so special with this vcvarsall.bat that the user must install Microsoft's programs in order to use it?
Why not just extract out this vcvarsall.bat file as an independent file and then just copy&paste it to any file or directory that needs and not bother with the rest of the software package?
Why not the Python team just extract out this vcvarsall.bat and incorporate it into its Python packages so whenever a user installs Python, he/she will also install vcvarsall.bat along the way and then Python would also know where to look for this file in case needing to install Cython or Numba or any other?
If you're using the python.org version of Python, there's a much easier way to go about things - grab the packages you're interested in from Christoph Gohlke's Python Extension Packages for Windows repository. He has a very large selection of mainly scientific computing-based Python modules, including Cython and numba (you'll need numpy - compiled with Intel's MKL - and llvmlite - which requires this - as well). Everything is precompiled into .whl packages that can be installed with an up-to-date version of pip. Most modules are kept updated with the latest versions on PyPI or other repositories.
This is definitely my go-to site for installing packages on Windows, and if what I'm looking for isn't there, then I'll install via pip or the package source.

including python package dependecy as an executable

Currently my python package does not have a dependency on the wmi package and it can be easily installed via
pip install mypackage
If I add a dependency on the wmi package, this will likely fail since when I try installing wmi through pip, I encounter errors since I do not have visual studio 2008 installed...and I only managed to get it installed using the binary distribution.
Is it possible for me to include and install the binary release of wmi in my package?
The main concern is that if people fail to install my package via the pip command, they just avoid using my package.
The first thing to consider is why are you considering adding the wmi package - since it is MS-Windows specific if you use it, or anything depending on it, your package will also be MS-Windows specific.
Are there other ways to achieve what you are trying to do that remain cross platform? If not and you really have to use it then you could include a prerequisite statement in the documentation, and ideally in setup.py, telling people that they need to have an installed & working copy of wmi, hopefully with a pointer to the binary distributions.
The other way to go - if you are on a late enough version of python - is to build and distribute your package as python wheels. Since wheels allow the inclusion of C package elements without relying on the presence of a compiler on the target system - see pep-0427 & here for some more information.
Creating Wheels:
You need to be running python2 > 2.6 or python3, pip >= 1.4 and setuptools >= 0.8.
Basically, assuming that you have a setup.py that will create your, (source), distribution for upload to pip with:
python setup.py sdist
then you can create a binary distribution that should contain all the dependencies of your package for your current python version with:
python setup.py bdist_wheel
This will build a distribution wheel that includes the .pyc files and the binary files from the required packages.
But - you need to do this once for each version of python that you are planning of supporting, (virtualenv is magic for this), and on each platform if you are also planning on supporting 64 bit or mac. Unless, of course, you manage to make a pure python package that will run, without 2to3, under both python 2 & 3 in which case you can build a universal wheel - obviously you can not do this if you require .c extensions.
For more information on wheels see Wheel - Read The Docs.

How to require and install a package using python 3.x distutils?

I have a program that uses dateutil from the package index. I would like to have setup.py check for for its presence and try to get it using easy_install if it is not there.
The documentation for distutils seems to indicate that this can be done using the requires keyword in setup(), but when I try, it installs on a system without dateutil without giving a warning or installing the required package.
The only thing I could find on google was this blog post about the same issue which did not have any answer either.
Am I using distutils wrong? Do I need to subclass distutils.command.install and do the checking/installing myself?
Automatic downloading of dependencies is a feature introduced by setuptools which is a third-party add-on to distutils, in particular, the install_requires argument it adds. See the setuptools documentation for more information.
Another option is to use requirements.txt file with pip rather than using easy_install as a package installer. pip has now become the recommended installer; see the Python Packaging User Guide for more information.
Update [2015-01]: The previous version of this answer referred to the distribute fork of setuptools. The distribute fork has since been merged back into a newer active setuptools project. distribute is now dead and should no longer be used. setuptools and pip are now very actively maintained and support Python 3.
The argument install_requires in setup function from distutils work for me well, only if I create sdist distributive, like: python setup.py sdist

Categories