Import module from parent directory
1 | import sys |
1 ) Add a setup.py
to the root folder
The contents of the setup.py
can be simply
1 | from setuptools import setup, find_packages |
Basically “any” setup.py
would work. This is just a minimal working example.
2 )
Removing the package is also possible with pip uninstall package-name
, and package name can be read from pip list
Pillow(PIL) xor two image get ValueError: image has wrong mode
from pillow documentation see more
Logical XOR between two images.
Both of the images must have mode “1”.
if you want to get two RGB
picture xored, use numpy
or other codes mannually.
Python module do not have the attributes expected
1 | AttributeError: partially initialized module 'csv' has no attribute 'DictWriter' (most likely due to a circular import) |
Don’t name your file
csv.py
.
When you do so, Python will look in your file for thecsv
code instead of the standard librarycsv
module.