Skip to content
This repository has been archived by the owner on Jul 28, 2020. It is now read-only.

PIP package missing Cython dependency #4

Open
chrisspen opened this issue May 17, 2020 · 4 comments
Open

PIP package missing Cython dependency #4

chrisspen opened this issue May 17, 2020 · 4 comments

Comments

@chrisspen
Copy link

The package doesn't list Cython as a dependency. This breaks and prevents installation on a bare virtualenv, which fails with the error:

ModuleNotFoundError: No module named 'Cython'

The solution is to simply first run:

pip install Cython

but ideally the package should list Cython as a dependency so this will be done automatically.

@emmatyping
Copy link
Owner

The pyproject.toml lists Cython as a dependency https://github.com/ethanhs/pynanosvg/blob/master/pyproject.toml#L2

So I believe if you have a new enough pip, it should work.

The problem is declaring Cython as a dependency isn't enough, because the setup script needs to import Cython https://github.com/ethanhs/pynanosvg/blob/master/setup.py#L2

Also, fair warning: I don't plan on spending much more time on this project, especially since nanosvg is no longer actively maintained. I will review PRs if this project, but don't expect work from me on it, I have decided to focus on other projects.

I would be happy to take a PR that warns people should upgrade pip if the Cython import fails.

@chrisspen
Copy link
Author

That's interesting. I get this error in a Docker build that uses an ubuntu:18.04 image, but now that you mention it, I can't reproduce it on my normal Ubuntu 18.04 dev system. Even if I completely purge the global Cython package, pip is still able to install pynanosvg correctly in a virtualenv. It might just be isolated to Docker.

@emmatyping
Copy link
Owner

The pip that ships with Python 3 in Ubuntu 18.04 is too old. My guess is that your dev system has an upgraded pip, which supports installing the pyproject.toml specified dependencies. Also out of curiosity, what project is this for (if its open source).

@chrisspen
Copy link
Author

Yeah, but I always install Python 3.7 or 3.8 in my Docker builds for just that reason. The build it failed for was using Python 3.7.7, and that should be recent enough.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants