TUD-RST/pyplane

Make pyplane installable via pip

Closed this issue · 6 comments

From time to time I want my students to play around with pyplane. To make installation consistent with other python packages I suggest to aim for pip install pyplane.

I experimented in that direction in the develop-branch.

The following currently works for me (running from an arbitrary directory): pip install git+https://github.com/TUD-RST/pyplane.git@develop

Then, thanks to entry_points-magic of setuptools, I can use pyplanesimply from the command line.

However, currently this is only tested on linux (debian10).

  • Test for Windows
  • Test for MacOS
  • Adapt README.md

I fixed some bugs related to refactoring the directory structure.

To test the pip-installability the following should work from any commandline with python and git support (recent versions assumed)

pip install git+https://github.com/TUD-RST/pyplane.git@develop
pyplane

I used the these command in Ubuntu machine.

pip install git+https://github.com/TUD-RST/pyplane.git@develop
pyplane

Also install sip, but runnign main.py give

Traceback (most recent call last):
  File "main.py", line 20, in <module>
    import sip
ModuleNotFoundError: No module named 'sip'

I can import sip seperately.
The package still maintained?

The package still maintained?

More or less (if time allows).

I suspect some versioning problem. To track it down can you please provide the following information (command outputs):

python --version
which pip
python -c "import os; print(os.name)"
python -c "import platform; print(platform.system())"
python -c "import platform; print(platform.release())"
python -c "import sys; print('\n'.join(sys.path))"
python -c "import PyQt5; print(PyQt5.__file__)"

Also:

  • Note that there is a new branch for packaging: pip install --force-reinstall git+https://github.com/TUD-RST/pyplane.git@dev_python_packaging
  • The trouble-shooting-section of this branch might be interesting for you.
  • I just tested the installation in a new conda environment (with python3.8) on Debian10. I have no Ubuntu available right now.

I used pip3 install --force-reinstall git+https://github.com/TUD-RST/pyplane.git@dev_python_packaging in a virtual environment, and also installed pip3 install PyQt5 PyQt5-sip PyQt5-Qt sip.

python --version
Python 3.8.10
which pip3
/home/ziaee/git/WORKSHOPS/pyplane/pyplane_ve/bin/pip3
which pip
/home/ziaee/git/WORKSHOPS/pyplane/pyplane_ve/bin/pip
python -c "import os; print(os.name)"
posix
python -c "import platform; print(platform.system())"
Linux
python -c "import platform; print(platform.release())"
5.11.0-27-generic
python -c "import sys; print('\n'.join(sys.path))"
/usr/lib/python38.zip
/usr/lib/python3.8
/usr/lib/python3.8/lib-dynload
/home/ziaee/git/WORKSHOPS/pyplane/pyplane_ve/lib/python3.8/site-packages
python -c "import PyQt5; print(PyQt5.__file__)"
/home/ziaee/git/WORKSHOPS/pyplane/pyplane_ve/lib/python3.8/site-packages/PyQt5/__init__.py
python main.py
Traceback (most recent call last):
  File "main.py", line 20, in <module>
    import sip
ModuleNotFoundError: No module named 'sip'

pyplane can be imported in ipython.

Oh wait: which script main.py are you executing? The branch dev_python_packaging has no such file anymore (only __main__.py).

The recommended way to start pyplane for the new pip-installable version is to use the command line script (which is created by setup.py during installation):
pyplane

Alternatively, the following should also work:
python3 run_pyplane.py(in the project root directory)

Make sure that the correct branch (dev_python_packaging) is checked out.

Please note: This behavior is not yet official and thus not yet well documented.

Installation via pip form the source code is now supported in release 2.0.0

git clone https://github.com/TUD-RST/pyplane
cd pyplane
pip install .

After having the documentation we will also publish pyplane via PyPI.