I have an application I have written in Python, that is being packaged with Pyinstaller.
From what I understand (and I am not a lawyer) and from the Pyinstaller FAQ bundling the source code and distributing with my own license seems like it is OK (points 1 and 2). I have no intention of modifying the Pyinstaller source in anyway, so I don't believe there are any issues here (relating to the Pyinstaller GPL license, points 4 and 5).
My question is specifically about my dependencies, beyond the standard library. pip list for my Virtual Environment gives
(venv) pip list
Package Version
-------------- ---------
altgraph 0.16.1
colorama 0.4.1
et-xmlfile 1.0.1
future 0.18.2
jdcal 1.4.1
nose 1.3.7
numpy 1.17.4
openpyxl 3.0.0
pefile 2019.4.18
Pillow 7.0.0
pip 19.0.3
PyInstaller 3.5
pywin32-ctypes 0.2.0
setuptools 40.8.0
Using numpy as an example pip show numpy
(venv) pip show numpy
Name: numpy
Version: 1.17.4
Summary: NumPy is the fundamental package for array computing with Python.
Home-page: https://www.numpy.org
Author: Travis E. Oliphant et al.
Author-email: None
License: BSD
Location: c:\dev\tool\venv\lib\site-packages
Requires:
Required-by:
And if I look at the BSD license file
* Redistributions in binary form must reproduce the above
copyright notice, this list of conditions and the following
disclaimer in the documentation and/or other materials provided
with the distribution.
Does this mean that I need to copy the numpy LICENSE.txt file, and distribute it along with my distributed application (and the same for all other dependencies)? Does this example constitute redistribution in binary form?, or have I misunderstood the meaning here?
It seems like any project with more than a few dependencies, that was using Pyinstaller would have a very large task to keep on top of these dependencies, and so it made me wonder if I was understanding these concepts correctly.
Yep, that's what it means. This is why e.g. your car, your TV, etc. have a "Open Source Licenses" view somewhere in the menus.
On a related note, I've written a tool, license-grep that generates a collated list of the various licenses used by projects in various languages.
Related
When downloading numpy I encountered a failure at the end,
ERROR: Could not install packages due to an OSError: [WinError 2] The system cannot find the file specified: 'c:\\python310\\Scripts\\f2py.exe' -> 'c:\\python310\\Scripts\\f2py.exe.deleteme'
and while installing aitextgen i received this error:
ERROR: Cannot install aitextgen==0.3.0, aitextgen==0.4.0, aitextgen==0.4.1, aitextgen==0.5.0, aitextgen==0.5.1 and aitextgen==0.5.2 because these package versions have conflicting dependencies.`
The conflict is caused by:
aitextgen 0.5.2 depends on torch>=1.6.0
aitextgen 0.5.1 depends on torch>=1.6.0
aitextgen 0.5.0 depends on torch>=1.6.0
aitextgen 0.4.1 depends on torch>=1.6.0
aitextgen 0.3.0 depends on torch>=1.6.0
No idea what's causing this. I've reinstalled Python using chocolatey. Is it an issue involving an installation path? Any help is greatly appreciated.I installed these using the pip3 install [module] method.
If I judge your path to python correctly:
c:\\python310\\
Then you have python 3.10 installed. This is at this point only a beta version, not even officially released.
aitextgen 0.5.2 depends on torch>=1.6.0
The issue here is that torch only has whl files available on pypi and only up to python 3.9. You will face this problem often, as it will take some time, probably after the release scheduled in october to have official support for many python modules.
You options:
Install an earlier version of python - this is probably your best option. You probably don't depend on any specific python 3.10 features
Download and compile torch from source - this will be both tricky, esspecially on windows and is also not guaranteed to work. There is at this point no official support for python 3.10 from torch. You will probably also have to solve a similar problem for other modules when sitcking with pyhon 3.10
I tried to run Pennylane on Colab, so I install it first. But the "Installed devices" are null, what's going on? I have restart and rebuilt for several times. Here is my code.
!pip install pennylane pennylane-qiskit
import pennylane as qml
qml.about()
Here is the result (with nothing in "Installed devices"):
Successfully built qiskit python-constraint contextvars yfinance docplex dlx
Installing collected packages: semantic-version, appdirs, pennylane, sympy, fastjsonschema, retworkx, python-constraint, ply, immutables, contextvars, qiskit-terra, pybind11, qiskit-aer, websockets, cryptography, ntlm-auth, requests-ntlm, qiskit-ibmq-provider, qiskit-ignis, inflection, quandl, lxml, yfinance, docplex, dlx, qiskit-aqua, qiskit, pennylane-qiskit
Found existing installation: sympy 1.1.1
Uninstalling sympy-1.1.1:
Successfully uninstalled sympy-1.1.1
Found existing installation: lxml 4.2.6
Uninstalling lxml-4.2.6:
Successfully uninstalled lxml-4.2.6
Successfully installed appdirs-1.4.4 contextvars-2.4 cryptography-3.2.1 dlx-1.0.4 docplex-2.15.194 fastjsonschema-2.14.5 immutables-0.14 inflection-0.5.1 lxml-4.6.1 ntlm-auth-1.5.0 pennylane-0.12.0 pennylane-qiskit-0.12.0 ply-3.11 pybind11-2.6.0 python-constraint-1.4.0 qiskit-0.23.0 qiskit-aer-0.7.0 qiskit-aqua-0.8.0 qiskit-ibmq-provider-0.11.0 qiskit-ignis-0.5.0 qiskit-terra-0.16.0 quandl-3.5.3 requests-ntlm-1.1.0 retworkx-0.5.0 semantic-version-2.6.0 sympy-1.6.2 websockets-8.1 yfinance-0.1.55
Name: PennyLane
Version: 0.12.0
Summary: PennyLane is a Python quantum machine learning library by Xanadu Inc.
Home-page: https://github.com/XanaduAI/pennylane
Author: None
Author-email: None
License: Apache License 2.0
Location: /usr/local/lib/python3.6/dist-packages
Requires: semantic-version, scipy, autograd, networkx, numpy, appdirs, toml
Required-by: PennyLane-qiskit
Platform info: Linux-4.19.112+-x86_64-with-Ubuntu-18.04-bionic
Python version: 3.6.9
Numpy version: 1.18.5
Scipy version: 1.4.1
Installed devices:
When I tried to use device, I got
raise DeviceError("Device does not exist. Make sure the required plugin is installed.")
Try upgrading the pennylane-sf library as mentioned here:
!pip install pennylane-sf --upgrade
Restart the runtime and that's it!
https://discuss.pennylane.ai/t/tutorial-for-gaussian-boson-sampling-sample-code/728
Had been answered here:
https://discuss.pennylane.ai/t/error-when-calling-device/259/35
See the url for detail.
I'm building my own install of Python, then using pip to install some packages into it. I want to use the pre-built binary wheels for packages like Cryptography.
Python 2.7.15 / 2.7.16
Pip 19.0.3
Setuptools 40.8.0
On GNU/Linux is just works: it grabs the manylinux1 wheel and everything works just fine.
On MacOS, it refuses to download any of the binary wheels for most versions. I've added lots of -v options to pip, but all it says is:
$ mypython -s -u -m pip install -v --only-binary 'cryptography' 'cryptography==2.6.1'
...
Skipping link https://files.pythonhosted.org/packages/.../cryptography-2.6.1-cp27-cp27m-macosx_10_6_intel.whl#sha256=... (from https://pypi.org/simple/cryptography/) (requires-python:>=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*); it is not compatible with this Python
...
Could not find a version that satisfies the requirement cryptography==2.6.1 (from versions: 1.0.1, 1.0.2, 1.1, 1.1.1, 1.1.2, 1.2, 1.2.1, 1.2.2, 1.3.1, 1.3.2, 1.3.3, 1.3.4, 1.4, 1.5, 1.5.1, 1.5.2, 1.5.3, 1.6, 1.7, 1.7.1, 1.8, 1.8.1, 1.8.2)
I've tried to understand why those particular versions are OK but not the latest, and the only thing I can see is that those versions have a specific x86_64 wheel package, while the later ones only have the fat binary intel wheel packages. My Python has a package definition of:
>>> import distutils.util
>>> distutils.util.get_platform()
'macosx-10.12-x86_64'
So I wondered if that was it. I modified my Python build to use MACOSX_DEPLOYMENT_TARGET=10.6 and added --enable-universalsdk=/ --with-universal-archs=intel to the configure line, and now my Python reports this:
>>> import distutils.util
>>> distutils.util.get_platform()
'macosx-10.6-intel'
However, I still get exactly the same messages from pip when I try to install.
So I'm wondering, is there any way I can get pip to be more informative and tell me exactly what about these binary packages it doesn't like, that is causing it to say "is not compatible" and skip them?
Thanks to a hint from #wim I found this command:
$ mypython
...
>>> from setuptools.pep425tags import get_supported
>>> for t in get_supported(): print(str(t))
...
This shows the full list of tuples used to match supported packages. Using this information I was able to compare it to the PyPI downloads and discover that I had built my MacOS Python with UCS4 support (which is common on Linux) where relatively few PyPI packages provide wide unicode binary wheels for MacOS.
I have no particular reason to prefer UCS4 so I switched my MacOS builds to UCS2 and it worked!
Hopefully this information will prove helpful to someone else.
Regarding the tags, recent versions of pip are able to output the full list of tags compatible with the currently running Python interpreter via the debug command:
$ path/to/pythonX.Y -m pip debug --verbose
WARNING: This command is only meant for debugging. Do not use this with automation for parsing and getting these details, since the output and options of this command may change without notice.
[...]
Compatible tags: 87
cp38-cp38-manylinux2014_x86_64
cp38-cp38-manylinux2010_x86_64
cp38-cp38-manylinux1_x86_64
cp38-cp38-linux_x86_64
cp38-abi3-manylinux2014_x86_64
cp38-abi3-manylinux2010_x86_64
cp38-abi3-manylinux1_x86_64
cp38-abi3-linux_x86_64
cp38-none-manylinux2014_x86_64
cp38-none-manylinux2010_x86_64
cp38-none-manylinux1_x86_64
cp38-none-linux_x86_64
cp37-abi3-manylinux2014_x86_64
cp37-abi3-manylinux2010_x86_64
cp37-abi3-manylinux1_x86_64
cp37-abi3-linux_x86_64
[...]
MacOS High Sierra 10.13.2 Early 2016 Rose Gold MacBook
I have done a LOT to get TensorFlow installed (REALLY should have just used pip3 from the start...) and now need to set the path of it so I can import it. Currently, I know it is installed; pip3 show tensorflow gets Name: tensorflow
Version: 1.8.0
Summary: TensorFlow helps the tensors flow
Home-page: https://www.tensorflow.org/
Author: Google Inc.
Author-email: opensource#google.com
License: Apache 2.0
Location: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages
Requires: numpy, absl-py, gast, termcolor, astor, protobuf, grpcio, wheel, six, tensorboard
This is great, but importing tensorflow still doesn't work. I figured out that I need to set the path from some googling and found this command: PYTHONPATH=/your/tensorflow/path:$PYTHONPATH. However, what am I supposed to do with it? Should I replace 'PYTHONPATH' with something? How do I tell it that that points to tensorflow? Should it be like this:
PYTHONPATH=/Users/rose/tensorflow/path:$tensorflow
I'm trying resolve a behavior difference between two python installations that are usually deterministic and have the same python pip packages installed.
I suspect different .so files. Is there a why to see which binaries binary wheels pip has installed, and for which architectures?
Update --
% pip show
Name: scipy
Version: 1.0.0rc1
Summary: SciPy: Scientific Library for Python
Home-page: https://www.scipy.org
Author: SciPy Developers
Author-email: scipy-dev#python.org
License: BSD
Location: /usr/local/lib/python2.7/dist-packages
Requires: numpy
The above package depends on things like libopenblas which must be compiled. I'm not sure if pip used the system installation, or compiled BLAS during a pip install, or used as precompiled version of BLAS for a i386, or i686 -- who knows.
The above case I have:
/usr/local/lib/python2.7/dist-packages/scipy/.libs/libopenblasp-r0-39a31c03.2.18.so
I'd like to see which package have differences in their installed .sos in difference systems.
The information is there, but you'll have to dig around in dist-info and/or egg-info subdirectories to find it.
Binary distributions include a RECORD file in their metadata subdirectory.
Source distributions include an installed-files.txt file in their metadata subdirectory.
The RECORD files are csv lines of (path, hash, size) as documented in PEP-376. The older installed-files.txt from an egg is just the filenames, and you'll have to stat those files manually.
As a simple example, I have source and binary distributions of my package copyingmock available on PyPI. With the binary distribution installed (pip install copyingmock):
$ pip show --files copyingmock
Name: copyingmock
Version: 0.1
Summary: A subclass of MagicMock that copies the arguments
Home-page: https://github.com/wimglenn/copyingmock
Author: Wim Glenn
Author-email: hey#wimglenn.com
License: MIT
Location: /tmp/blah/venv/lib/python3.6/site-packages
Requires:
Files:
__pycache__/copyingmock.cpython-36.pyc
copyingmock-0.1.dist-info/DESCRIPTION.rst
copyingmock-0.1.dist-info/INSTALLER
copyingmock-0.1.dist-info/LICENSE.txt
copyingmock-0.1.dist-info/METADATA
copyingmock-0.1.dist-info/RECORD
copyingmock-0.1.dist-info/WHEEL
copyingmock-0.1.dist-info/metadata.json
copyingmock-0.1.dist-info/top_level.txt
copyingmock.py
$ cat venv/lib/python3.6/site-packages/copyingmock-0.1.dist-info/RECORD
copyingmock.py,sha256=DoLAuaS7KqGT87BIlD93G1M7q9bNWgHYu1m1TZP1D1g,345
copyingmock-0.1.dist-info/DESCRIPTION.rst,sha256=L_0CS_8XNYgAVfq3tj3GZEYg_9vML9nDP-FUU37GIbs,1541
copyingmock-0.1.dist-info/LICENSE.txt,sha256=sDdX5cBRRpk3rmZ8hbYEfAUIYRdDqrlXmChOUkqf62o,1066
copyingmock-0.1.dist-info/METADATA,sha256=bKJ5RXwvj0rGrg22p4K91WiJoLM5MqLHYqlpWYWUhPU,2031
copyingmock-0.1.dist-info/RECORD,,
copyingmock-0.1.dist-info/WHEEL,sha256=5wvfB7GvgZAbKBSE9uX9Zbi6LCL-_KgezgHblXhCRnM,113
copyingmock-0.1.dist-info/metadata.json,sha256=SLtuqq4tUGr0A2h4hQnZEdPIm_4MrvcunLzP-_1I7Qc,677
copyingmock-0.1.dist-info/top_level.txt,sha256=X3FsY_0npOxR5rKvOJ-b2rdiNfSiIivwVKN4JgY7cac,12
copyingmock-0.1.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
__pycache__/copyingmock.cpython-36.pyc,,
Then forcing to reinstall with the source distribution (pip uninstall copyingmock and then pip install --no-binary=copyingmock copyingmock):
$ pip show --files copyingmock
Name: copyingmock
Version: 0.1
Summary: A subclass of MagicMock that copies the arguments
Home-page: https://github.com/wimglenn/copyingmock
Author: Wim Glenn
Author-email: hey#wimglenn.com
License: MIT
Location: /tmp/blah/venv/lib/python3.6/site-packages
Requires:
Files:
__pycache__/copyingmock.cpython-36.pyc
copyingmock-0.1-py3.6.egg-info/PKG-INFO
copyingmock-0.1-py3.6.egg-info/SOURCES.txt
copyingmock-0.1-py3.6.egg-info/dependency_links.txt
copyingmock-0.1-py3.6.egg-info/top_level.txt
copyingmock.py
$ cat venv/lib/python3.6/site-packages/copyingmock-0.1-py3.6.egg-info/installed-files.txt
../copyingmock.py
../__pycache__/copyingmock.cpython-36.pyc
dependency_links.txt
PKG-INFO
top_level.txt
SOURCES.txt