Skip to content

[Caffe2] Fixing missing PyCObject_Type bug - #8467

Merged
orionr merged 1 commit into
pytorch:masterfrom
pjh5:nother_conda_fix
Jun 14, 2018
Merged

orionr merged 1 commit into
pytorch:masterfrom
pjh5:nother_conda_fix

Conversation

@pjh5

@pjh5 pjh5 commented Jun 14, 2018

Copy link
Copy Markdown
Contributor

Also includes the changes in #8434 because they both affect cmake/Dependencies.cmake

The changes to scripts/build_anaconda.sh were just to make it more consistent with other build scripts and unrelated to the bug.

The addition of python 3.5 and 3.6 to find_python and the addition of setuptools to the meta.yaml together seem to fix the problem. Without having python 3.5 and 3.6 as additional python versions, the find_python code sometimes picks up different python installations for the libraries and the executable.

With anaconda3, new environments come completely empty, even without python or setuptools. They will default to the first python version of the first package you install into them. When installing Caffe2 into such brand new environments, using distutils or setuptools will actually use the setuptools present in the root conda environment (since the new conda envs don't come with them), and so the sysconfig.get_python_lib() will actually be for root conda env instead of the activated env. This may not actually affect clean brand new conda caffe2 packages if they are all installed into neat conad envs, but it can cause strange behavior and be really annoying to debug if you don't expect it.

@pjh5 pjh5 changed the title Fixing missing PyCObject_Type bug [Caffe2] Fixing missing PyCObject_Type bug Jun 14, 2018
@pjh5

pjh5 commented Jun 14, 2018

Copy link
Copy Markdown
Contributor Author

@pytorchbot retest this please

@pjh5

pjh5 commented Jun 14, 2018

Copy link
Copy Markdown
Contributor Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants