pixel
pixel copied to clipboard
Package installation and PyPi distribution
Trying to install this repository:
pip install git+https://github.com/xplip/pixel
Collecting git+https://github.com/xplip/pixel Cloning https://github.com/xplip/pixel to ./tmp/pip-req-build-ijxd55pn Running command git clone --quiet https://github.com/xplip/pixel /home/nlp/amit/tmp/pip-req-build-ijxd55pn Resolved https://github.com/xplip/pixel to commit efb38f5d54ee04874f61a92aebb3d8403fecf38c Running command git submodule update --init --recursive -q Preparing metadata (setup.py) ... done
Then
python -c "import pixel"
Traceback (most recent call last): File "
", line 1, in ModuleNotFoundError: No module named 'pixel'
I guess it does not install the actual python "package" called "pixel".
If you would add PyPi distribution as well, it would not need to also install the git submodules, which actually takes long as datasets
is big.
Here's my suggestion: https://github.com/xplip/pixel/pull/3
However, the name pixel
is taken, so you would need to come up with a different pypi package name (this does not change the fact that the installed package will be called pixel
)
Thanks for the suggestion! I think it's a good idea to distribute pixel via PyPi. The main reason we currently only support the installation via eggs (running pip install -e git+https://github.com/xplip/pixel#egg=pixel
should work) is because we rely on external system libraries (pango, cairo, pangocairo, and their respective dependencies) which need to be installed beforehand, and we give instructions on how to do so here in the repo. If we distributed the package as-is, people would be able to install it from PyPi without a warning and then encounter errors at runtime if they don't have these external libraries installed.
I think a good way around this will be to build some Linux and macOS platform wheels for pixel and distribute these via PyPi. I'll try to do that this week :).
There's seemingly a missing requirement:
pip install -e git+https://github.com/xplip/pixel#egg=pixel
cd src/pixel
pip install -r requirements.txt
python -c "import pixel"
ModuleNotFoundError: No module named 'cairo'
(in https://github.com/xplip/pixel/blob/main/src/pixel/data/rendering/pangocairo_renderer.py#L8)
Tried:
conda install -c anaconda cairo
pip install pycairo
But pycairo
does not recognize cairo, i'll sort it out.
Just wasn't sure if you meant to make it an optional dependency, or had to do it this way as cairo is external, so thought i'll flag it
Note: if there are installation instructions for this repository, I haven't managed to find them
Sorry for the confusion, you can find the installation instructions by clicking on "Show instructions" under https://github.com/xplip/pixel#setup. Maybe I should make it easier to find. If you run this command conda install -c conda-forge pycairo pygobject manimpango
instead of installing pycairo
via pip
, the error should hopefully be resolved.
Alternatively, running sudo apt install libgirepository1.0-dev gcc libcairo2-dev pkg-config python3-dev gir1.2-gtk-3.0 libpango1.0-dev libpangocairo-1.0-0
together with pip install pycairo PyGObject manimpango
should do the job without conda.
I am stuck at cairo not found error. Any suggestion?
I am stuck at cairo not found error. Any suggestion?
Have you followed the steps above to install cairo / setup your environment? I can try to help identify the problem if you provide some additional information. Could you please 1) paste the exact error message you are getting and let me know 2) when this error occurs (which command you are executing), 3) whether you are using conda, and 4) which operating system you are on?
Here is the error message : from pandas.core.computation.check import NUMEXPR_INSTALLED
Traceback (most recent call last):
File "scripts/training/run_pos.py", line 27, in
After the initial setup, I was trying to do the sanity check in fine-tuning. I am using conda. I am working on a remote server (LInux) where I do not have sudo permission.
Sorry for the late reply. It seems like cairo is not installed correctly in your conda environment. If you run conda list cairo
, you should get an output similar to mine below
conda list cairo
# packages in environment at /home/plip/miniconda3/envs/pixel-env:
#
# Name Version Build Channel
cairo 1.16.0 ha12eb4b_1010 conda-forge
pycairo 1.21.0 py39h0934665_1 conda-forge
Could you run the same command and check if you have both packages installed, ideally with similar version numbers? If they are both installed, but it still doesn't work, maybe try installing the exact same versions I have via
conda install cairo=1.16.0=ha12eb4b_1010 -c conda-forge
conda install pycairo=1.21.0=py39h0934665_1 -c conda-forge
make sure this matches your python version too (I am using python 3.9). The setup via conda should work fine without having root access. Let me know if this helps!