Enthought Canopy on Mac OS X installing external program Dolfin (FEniCS) - python

Over the past few weeks I started programming in Python and have been using Enthought Canopy's python environment (using Mac OS X). I'm interested in modeling incompressible Navier-Stokes equation using the python module FEniCS/DOLFIN, but I have been having problems trying to install it.
Initially, I downloaded DOLFIN for python at: https://pypi.python.org/pypi/DOLFIN/1.2.0 . Inside the DOLFIN folder's Install file, there are steps for a 'Simple build and install' and it says to issue the commands:
cmake .
make install
So, I downloaded Cmake from: www. cmake .org (assuming all I have to do is download and install it, then I'll be able to reference cmake in the terminal).
Then I went into the Mac terminal, went to the location of the DOLFIN folder, and tried the above commands...
(Canopy 64bit) Ryans-MacBook-Pro:~ rms1000watt$ cd
/Users/rms1000watt/Documents/Programs/dolfin-1.2.0
(Canopy 64bit) Ryans-MacBook-Pro:dolfin-1.2.0 rms1000watt$ cmake .
-bash: cmake: command not found
(Canopy 64bit) Ryans-MacBook-Pro:dolfin-1.2.0 rms1000watt$ make install
make: Nothing to be done for `install'.
... which clearly didn't work.
So, I thought I would try to just install FEniCS in its entirety from: fenicsproject.org/download/osx_details.html
However, FEniCS is built against system Python and will not work with other Python packages.
(Enthought Canopy provided information to install external packages: https://support.enthought.com/entries/23389761-Installing-external-packages-into-Canopy-Python . But, I figured I was following step 2 by the 'Follow standard python installation procedures from the command line'.)
So, in short, I'm at a loss for how to install DOLFIN into Enthought Canopy.

Clearly the cmake executable is not in your PATH; that's why you get the cmake: command not found message. Locate your cmake executable with
find / -name 'cmake' -perm -111 -type file
(on my system the result is /Applications/CMake 2.8-9.app/Contents/bin/cmake, for instance; it's likely to be similar on yours). Then run cmake using the full path, e.g.
/Applications/CMake\ 2.8-9.app/Contents/bin/cmake .
(note the backslash before the space in the directory name). Of course you can also add CMake's bin directory to your PATH instead.

Related

Install PyQt5.15.4 from tar.gz file

I'm trying to install PyQt5.15.4 on a remote desktop that is not connected to internet (Anaconda distribution and PyCharm installed), hence I downloaded the tar.gz files from https://pypi.org/project/PyQt5/#files and tried to use this solution : Python import library from tar.gz? (it worked for other libraries I had to install such as python-docx). The problem is that there is no setup.py file. There is a configure.py file (I imagine it roughly do the same job), so I tried in cmd :
python configure.py install --prefix=<full path folder I used for other libraries I needed>
but I get:
Usage: python configure.py [opts] [name=value] [name+=value]
configure.py: error: no such option: --prefix
Do you have a tip ?
Download PyQT5 from here. https://www.riverbankcomputing.com/pypi/packages/PyQt5/PyQt5-5.15.5.dev2108100905.tar.gz#md5=b39c03d821123c37715daffb0c1c3bb1
This will download tar.gz fie. open the terminal, CD through the relative path, paste the command here.
pip install PyQt5-5.15.5.dev2108100905.tar.gz
if you have your own tar.gz. Then use the name of that file, which will install automatically.
pip install yourfile.tar.gz
Please let me know if that works

Windows 10 linux subsystem ubuntu trying to install python pip

It's the first time ever for me to use a linux terminal. In my case I activated windows 10 linux subsystem and installed ubuntu because as I have seen it's much more versatile than windows cmd. Now I was trying to create venv for my python project through ubuntu terminal, but i can't undersand why every time i run a command that requires the previous installation of a package such as pip install ... or virtualenv -p python3 venv (which i had already installed time ago through windows cmd) I get
`Command 'virtualenv' not found, but can be installed with:
sudo apt install virtualenv`
and if I run the suggested commands I get:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package virtualenv
In all this my current working directory is the project directory where i intend to place my files, everything worked when i tried to achieve the same result with windows cmd.
Hope what i wrote is clear enough.

How to install Python packages from python3-apt in PyCharm on Windows?

I'm on Windows and want to use the Python package apt_pkg in PyCharm.
On Linux I get the package by doing sudo apt-get install python3-apt but how to install apt_pkg on Windows?
There is no such package on PyPI.
There is no way to run apt-get in Windows; the package format and the supporting infrastructure is very explicitly Debian-specific.
Not quite what you're looking for, but it's possible to use apt-offline on Windows to download the packages. However, you still need a Linux box to generate the sig file.
For example:
python apt-offline set vim-offline.sig --install-packages vim
Will not work:
ERROR: This argument is supported only on Unix like systems with apt installed
However, if you run that command on Linux first, the following command should work on Windows:
python apt-offline get vim-offline.sig -d vim
apt-offline source is available here:
https://github.com/rickysarraf/apt-offline
To build it, simply run:
python setup.py build
python setup.py install
I got it to run with Python 3.8.2 on Windows 10.
Note: in the end of the day, you're just downloading a .deb package and it is simply an ar file containing a tarball and can be extracted with tools like 7-zip. However, if it contains a Linux binary (vim example), there isn't much you can do with it on Windows.
One can use chocolatey the equivalent for windows.
https://chocolatey.org/install
add it to the windows PATH environment
C:\ProgramData\chocolatey\bin
Restart python or anaconda. And is ready to use.
To install packages inside a .py script or a Jupiter notebook, use the syntax below
!choco install [package name]

Pyinstaller command not found (MacOS)

I've been trying to use PyInstaller on my program, scratch_1.py. The PyCharm project folder is called "idigen", which is saved in my desktop. So, I changed the director like so:
cd /Users/joelsaarinen/Desktop/idigen
then, moved on to use pyinstaller, and I get this error:
pyinstaller scratch_1.py
-bash: pyinstaller: command not found
I'm confused because when I use:
pip show pyinstaller
to verify that I have pyinstaller installed, it returns a positive result.
Is there an additional command I should be putting in when using Pyinstaller on one of my files? Might this be an issue with this specific program or the operating system in general? Thanks in advance.
This is a common problem due to the fact that you might install a different version of python and keep using an old version that is preinstalled in the machine. Here is the best solution.
First, check the version of the python that you installed. In my case, i installed python 3.5 and the machine had python2.7. If you run python on the terminal, most likely the preinstalled one is the one that will run.
Second, check the directory of your desired python version. watch -a python3 is the command to run to see your directory.
Third, set the directory as the main one to run your python commands.
alias python=/usr/local/bin/python3 does the whole trick
Lastly, reinstall pip. Download the get-pip.py file and run sudo /usr/local/bin/python3 get-pip.py * I used the path to show the reason we updated the alias*
Now you can run pyinstaller without problems
pyinstaller appears to have installed correctly, but the command is not available on PATH. You need to locate where the executable was placed.`below to find executables
set | grep pyinstaller
now modify path by this
export PATH=some_path:another_path
launchctl setenv PATH $PATH
I just downloaded the source code of pyInstaller from official website, put it where I can find it and wrote a script which launches pyinstaller.py from that folder.
For some reason, pyinstaller.py is missing in the pyInstaller installation downloaded via pip.
I had the same issue on MacOS with Developer Tools 11.4 and found two ways to start pyinstaller:
alt 1: path based solution
$ pip3 show -f pyinstaller|grep pyinstaller
will find pyinstaller in a bin path:
../../../../usr/local/bin/pyinstaller
...
So you can use one of the set-the-path-or-an-alias approaches or call via fully qualified path.
alt 2: call via python module
$ pip3 show -f pyinstaller|grep __init__
will get you a hint on how pyinstaller is defined as a module:
PyInstaller/__init__.py
...
With that capitalization, it's possible to call pyinstaller as a module with the following:
$ python3 -m PyInstaller --version
4.2
I'm using the latter now.

How do I install py2app onan off-internet PC

I have downloaded py2app, but the problem is that easy install seems to be an online installation, yet I am installing this on an off-line pc, so can't use easy install. I expected to be able to download an EXE file or MSI file to install it on my PC using a normal procedure to install a Python package, because the python packages that I have installed before have been from self running files.
The downloadable version of Py2app does not include any such self running file. It tells me to type $python setup.py install. Where do I type this? Into what command line?
If you're running Windows (and it seems that you're) you will need to go to the Run window (Win + R) and...
type cmd
type python setup.py install
...to begin the instalation.
If you doesn't have Python on your PATH, the use:
C:\PythonXY\python.exe setup.py install (for example, in Python 2.7 use C:\Python27\python.exe setup.py install).
Also maybe you need to specify the setup.py path so you should do:
C:\PythonXY\python.exe C:\Some\Path\setup.py install.
If you're running any Linux distro then just open the terminal and type that command.
Hope it helps!
You need to download an install the following packages (in this order):
altgraph
macholib
modulegraph
py2app
All of them can be installed by first downloading and extracting the archive and then run "python setup.py install" with the current working directory set to the directory containing the setup.py file.
However... You appear to want to install py2app on a Windows PC, and that won't work because py2app does not support Windows (it cannot cross "compile" a Mac application bundle).

Categories

Resources