RTD build issue via ipython dependency

I’m wondering if anybody else in the Jupyter/IPython community that manages a readthedocs (RTD) deployment has seen an issue like this. I’m getting this build error:

Cannot uninstall 'ptyprocess'. It is a distutils installed project and thus we cannot accurately determine which files belong to it which would lead to only a partial uninstall.

This is an error from pip >= 10, which is pulling in ptyprocess via the following dependency:

Collecting ptyprocess>=0.5 (from pexpect; sys_platform != "win32"->ipython>=4.0.0; python_version >= "3.3"->ipywidgets>=7.0.0-> [ my project ])

Any suggestions? Is the issue with my package, one of the Jupyter packages, or with RTD? I don’t have any experience resolving this kind of issue, and cannot reproduce it locally either.

I have seen that locally on conda-installed packages, that I try to upgrade with pip I believe. It’s usually local, so I just rm -rf manually the offender.

Thanks! The issue is indeed from trying to combine using conda and pip. While I don’t think I can stop combining these, at least now I know which things to tweak :smiley:

1 Like

The conda package should include setuptools metadata, but it doesn’t. See https://github.com/conda-forge/ptyprocess-feedstock/pull/15 for what should be a fix.

I think a workaround would be to pip install --ignore-installed ptyprocess to clobber the ptyprocess installed by conda with one with proper metadata.

Yes, there are several packages that should include the setuptools metadata (including certifi and docutils). More downstream, I reported this issue to RTD: https://github.com/rtfd/readthedocs.org/issues/5545 It was caused by a recent change for RTD to always use the flag --force-install with pip install, which exacerbated this issue.

Yeah, any time you find a package where that’s happening, feel fee to open an Issue (or PR!) on the conda-forge feedstock. Zero Python packages should be installed without setuptools metadata, even with conda.