tho*_*efe 5 python conda conda-build
我有一个本地 python 项目,jive我想在另一个项目中使用它。我当前在其他项目中使用的方法jive是激活项目的 conda env,然后移动到我的jive目录并使用python setup.py install. 这工作正常,当我使用 时conda list,我会看到环境中安装的所有内容,包括,以及使用 pip 安装的jive注释。jive
但我真正想要的是用完整的 conda 来做到这一点。当我想jive在另一个项目中使用时,我只想放入jive该项目中environment.yml。
所以我做了以下事情:
meta.yaml构建jiveconda build .jive预期的源代码environment.yml,并将“local”添加到频道列表中。当我激活环境并使用 时conda list,它会根据需要列出所有依赖项jive,包括 。但是当我打开python解释器时,我不能import jive,它说没有这样的包。(如果使用python setup.py install,我可以导入它。)
如何修复构建/安装以使其正常工作?
jive这是位于项目顶级目录中的meta.yaml :
package:
name: jive
version: "0.2.1"
source:
path: .
build:
script: python -m pip install --no-deps --ignore-installed .
requirements:
host:
- python>=3.5
- pip
- setuptools
run:
- python>=3.5
- numpy
- pandas
- scipy
- seaborn
- matplotlib
- scikit-learn
- statsmodels
- joblib
- bokeh
test:
imports: jive
Run Code Online (Sandbox Code Playgroud)
这是输出conda build .
No numpy version specified in conda_build_config.yaml. Falling back to default numpy value of 1.16
WARNING:conda_build.metadata:No numpy version specified in conda_build_config.yaml. Falling back to default numpy value of 1.16
Adding in variants from internal_defaults
INFO:conda_build.variants:Adding in variants from internal_defaults
Adding in variants from /Users/thomaskeefe/.conda/conda_build_config.yaml
INFO:conda_build.variants:Adding in variants from /Users/thomaskeefe/.conda/conda_build_config.yaml
Attempting to finalize metadata for jive
INFO:conda_build.metadata:Attempting to finalize metadata for jive
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done
BUILD START: ['jive-0.2.1-py310_0.tar.bz2']
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done
## Package Plan ##
environment location: /opt/miniconda3/conda-bld/jive_1642185595622/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla
The following NEW packages will be INSTALLED:
bzip2: 1.0.8-h1de35cc_0
ca-certificates: 2021.10.26-hecd8cb5_2
certifi: 2021.5.30-py310hecd8cb5_0
libcxx: 12.0.0-h2f01273_0
libffi: 3.3-hb1e8313_2
ncurses: 6.3-hca72f7f_2
openssl: 1.1.1m-hca72f7f_0
pip: 21.2.4-py310hecd8cb5_0
python: 3.10.0-hdfd78df_3
readline: 8.1.2-hca72f7f_1
setuptools: 58.0.4-py310hecd8cb5_0
sqlite: 3.37.0-h707629a_0
tk: 8.6.11-h7bc2e8c_0
tzdata: 2021e-hda174b7_0
wheel: 0.37.1-pyhd3eb1b0_0
xz: 5.2.5-h1de35cc_0
zlib: 1.2.11-h4dc903c_4
Preparing transaction: ...working... done
Verifying transaction: ...working... done
Executing transaction: ...working... done
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done
Copying /Users/thomaskeefe/Documents/py_jive to /opt/miniconda3/conda-bld/jive_1642185595622/work/
source tree in: /opt/miniconda3/conda-bld/jive_1642185595622/work
export PREFIX=/opt/miniconda3/conda-bld/jive_1642185595622/_h_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_pla
export BUILD_PREFIX=/opt/miniconda3/conda-bld/jive_1642185595622/_build_env
export SRC_DIR=/opt/miniconda3/conda-bld/jive_1642185595622/work
Processing $SRC_DIR
DEPRECATION: A future pip version will change local packages to be built in-place without first copying to a temporary directory. We recommend you use --use-feature=in-tree-build to test your packages with this new behavior before it becomes the default.
pip 21.3 will remove support for this functionality. You can find discussion regarding this at https://github.com/pypa/pip/issues/7555.
Building wheels for collected packages: jive
Building wheel for jive (setup.py): started
Building wheel for jive (setup.py): finished with status 'done'
Created wheel for jive: filename=jive-0.2.1-py3-none-any.whl size=46071 sha256=b312955cb2fd917bc4e684a575407b884190680f2dddad7fcb9ac25e5b290fc9
Stored in directory: /private/tmp/pip-ephem-wheel-cache-rbpkt2an/wheels/15/68/82/4ed7cd246fbc4c72cf764b425a03230247589bd2394a7e457b
Successfully built jive
Installing collected packages: jive
Successfully installed jive-0.2.1
Resource usage statistics from building jive:
Process count: 3
CPU time: Sys=0:00:00.3, User=0:00:00.5
Memory: 53.7M
Disk usage: 50.4K
Time elapsed: 0:00:06.1
Packaging jive
INFO:conda_build.build:Packaging jive
INFO conda_build.build:build(2289): Packaging jive
Packaging jive-0.2.1-py310_0
INFO:conda_build.build:Packaging jive-0.2.1-py310_0
INFO conda_build.build:bundle_conda(1529): Packaging jive-0.2.1-py310_0
compiling .pyc files...
number of files: 70
Fixing permissions
INFO :: Time taken to mark (prefix)
0 replacements in 0 files was 0.06 seconds
TEST START: /opt/miniconda3/conda-bld/osx-64/jive-0.2.1-py310_0.tar.bz2
Adding in variants from /var/folders/dd/t85p2jdn3sd11bsdnl7th6p00000gn/T/tmp4o3im7d1/info/recipe/conda_build_config.yaml
INFO:conda_build.variants:Adding in variants from /var/folders/dd/t85p2jdn3sd11bsdnl7th6p00000gn/T/tmp4o3im7d1/info/recipe/conda_build_config.yaml
INFO conda_build.variants:_combine_spec_dictionaries(234): Adding in variants from /var/folders/dd/t85p2jdn3sd11bsdnl7th6p00000gn/T/tmp4o3im7d1/info/recipe/conda_build_config.yaml
Renaming work directory '/opt/miniconda3/conda-bld/jive_1642185595622/work' to '/opt/miniconda3/conda-bld/jive_1642185595622/work_moved_jive-0.2.1-py310_0_osx-64'
INFO:conda_build.utils:Renaming work directory '/opt/miniconda3/conda-bld/jive_1642185595622/work' to '/opt/miniconda3/conda-bld/jive_1642185595622/work_moved_jive-0.2.1-py310_0_osx-64'
INFO conda_build.utils:shutil_move_more_retrying(2091): Renaming work directory '/opt/miniconda3/conda-bld/jive_1642185595622/work' to '/opt/miniconda3/conda-bld/jive_1642185595622/work_moved_jive-0.2.1-py310_0_osx-64'
shutil.move(work)=/opt/miniconda3/conda-bld/jive_1642185595622/work, dest=/opt/miniconda3/conda-bld/jive_1642185595622/work_moved_jive-0.2.1-py310_0_osx-64)
INFO:conda_build.utils:shutil.move(work)=/opt/miniconda3/conda-bld/jive_1642185595622/work, dest=/opt/miniconda3/conda-bld/jive_1642185595622/work_moved_jive-0.2.1-py310_0_osx-64)
INFO conda_build.utils:shutil_move_more_retrying(2098): shutil.move(work)=/opt/miniconda3/conda-bld/jive_1642185595622/work, dest=/opt/miniconda3/conda-bld/jive_1642185595622/work_moved_jive-0.2.1-py310_0_osx-64)
Collecting package metadata (repodata.json): ...working... done
Solving environment: ...working... done
## Package Plan ##
environment location: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol
The following NEW packages will be INSTALLED:
blas: 1.0-mkl
bokeh: 2.4.2-py39hecd8cb5_0
bottleneck: 1.3.2-py39he3068b8_1
brotli: 1.0.9-hb1e8313_2
ca-certificates: 2021.10.26-hecd8cb5_2
certifi: 2021.10.8-py39hecd8cb5_2
cycler: 0.11.0-pyhd3eb1b0_0
fonttools: 4.25.0-pyhd3eb1b0_0
freetype: 2.11.0-hd8bbffd_0
giflib: 5.2.1-haf1e3a3_0
intel-openmp: 2021.4.0-hecd8cb5_3538
jinja2: 3.0.2-pyhd3eb1b0_0
jive: 0.2.1-py310_0 local
joblib: 1.1.0-pyhd3eb1b0_0
jpeg: 9d-h9ed2024_0
kiwisolver: 1.3.1-py39h23ab428_0
lcms2: 2.12-hf1fd2bf_0
libcxx: 12.0.0-h2f01273_0
libffi: 3.3-hb1e8313_2
libgfortran: 3.0.1-h93005f0_2
libpng: 1.6.37-ha441bb4_0
libtiff: 4.2.0-h87d7836_0
libwebp: 1.2.0-hacca55c_0
libwebp-base: 1.2.0-h9ed2024_0
llvm-openmp: 12.0.0-h0dcd299_1
lz4-c: 1.9.3-h23ab428_1
markupsafe: 2.0.1-py39h9ed2024_0
matplotlib: 3.5.0-py39hecd8cb5_0
matplotlib-base: 3.5.0-py39h4f681db_0
mkl: 2021.4.0-hecd8cb5_637
mkl-service: 2.4.0-py39h9ed2024_0
mkl_fft: 1.3.1-py39h4ab4a9b_0
mkl_random: 1.2.2-py39hb2f4e1b_0
munkres: 1.1.4-py_0
ncurses: 6.3-hca72f7f_2
numexpr: 2.8.1-py39h2e5f0a9_0
numpy: 1.21.2-py39h4b4dc7a_0
numpy-base: 1.21.2-py39he0bd621_0
olefile: 0.46-pyhd3eb1b0_0
openssl: 1.1.1m-hca72f7f_0
packaging: 21.3-pyhd3eb1b0_0
pandas: 1.3.5-py39h743cdd8_0
patsy: 0.5.2-py39hecd8cb5_0
pillow: 8.4.0-py39h98e4679_0
pip: 21.2.4-py39hecd8cb5_0
pyparsing: 3.0.4-pyhd3eb1b0_0
python: 3.9.7-h88f2d9e_1
python-dateutil: 2.8.2-pyhd3eb1b0_0
pytz: 2021.3-pyhd3eb1b0_0
pyyaml: 6.0-py39hca72f7f_1
readline: 8.1.2-hca72f7f_1
scikit-learn: 1.0.2-py39hae1ba45_0
scipy: 1.7.3-py39h8c7af03_0
seaborn: 0.11.2-pyhd3eb1b0_0
setuptools: 58.0.4-py39hecd8cb5_0
six: 1.16.0-pyhd3eb1b0_0
sqlite: 3.37.0-h707629a_0
statsmodels: 0.13.0-py39hca72f7f_0
threadpoolctl: 2.2.0-pyh0d69192_0
tk: 8.6.11-h7bc2e8c_0
tornado: 6.1-py39h9ed2024_0
typing_extensions: 3.10.0.2-pyh06a4308_0
tzdata: 2021e-hda174b7_0
wheel: 0.37.1-pyhd3eb1b0_0
xz: 5.2.5-h1de35cc_0
yaml: 0.2.5-haf1e3a3_0
zlib: 1.2.11-h4dc903c_4
zstd: 1.4.9-h322a384_0
Preparing transaction: ...working... done
Verifying transaction: ...working...
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::intel-openmp-2021.4.0-hecd8cb5_3538, defaults/osx-64::llvm-openmp-12.0.0-h0dcd299_1
path: 'lib/libiomp5.dylib'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'bin/webpinfo'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'bin/webpmux'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'include/webp/decode.h'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'include/webp/encode.h'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'include/webp/mux.h'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'include/webp/mux_types.h'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'include/webp/types.h'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'lib/libwebp.7.dylib'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'lib/libwebp.a'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'lib/libwebp.dylib'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'lib/libwebpdecoder.3.dylib'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'lib/libwebpdecoder.a'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'lib/libwebpdecoder.dylib'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'lib/libwebpmux.3.dylib'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'lib/libwebpmux.a'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'lib/libwebpmux.dylib'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'lib/pkgconfig/libwebp.pc'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'lib/pkgconfig/libwebpdecoder.pc'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'lib/pkgconfig/libwebpmux.pc'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'share/man/man1/cwebp.1'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'share/man/man1/dwebp.1'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'share/man/man1/webpinfo.1'
ClobberWarning: This transaction has incompatible packages due to a shared path.
packages: defaults/osx-64::libwebp-base-1.2.0-h9ed2024_0, defaults/osx-64::libwebp-1.2.0-hacca55c_0
path: 'share/man/man1/webpmux.1'
done
Executing transaction: ...working...
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/llvm-openmp-12.0.0-h0dcd299_1/lib/libiomp5.dylib
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/libiomp5.dylib
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/libwebp-1.2.0-hacca55c_0/bin/webpinfo
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/bin/webpinfo
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/libwebp-1.2.0-hacca55c_0/bin/webpmux
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/bin/webpmux
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/libwebp-1.2.0-hacca55c_0/include/webp/decode.h
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/include/webp/decode.h
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/libwebp-1.2.0-hacca55c_0/include/webp/encode.h
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/include/webp/encode.h
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/libwebp-1.2.0-hacca55c_0/include/webp/mux.h
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/include/webp/mux.h
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/libwebp-1.2.0-hacca55c_0/include/webp/mux_types.h
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/include/webp/mux_types.h
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/libwebp-1.2.0-hacca55c_0/include/webp/types.h
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/include/webp/types.h
ClobberWarning: Conda was asked to clobber an existing path.
source path: /opt/miniconda3/pkgs/libwebp-1.2.0-hacca55c_0/lib/libwebp.7.dylib
target path: /opt/miniconda3/conda-bld/jive_1642185595622/_test_env_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehold_placehol/lib/libwebp.7.dylib
直接的错误是构建生成了 Python 3.10 版本,但在测试时 Conda 无法识别 Python 版本的任何约束,并创建了 Python 3.9 环境。
我认为主要问题是这python >=3.5只是构建时的有效约束noarch,而这不是。也就是说,一旦使用给定的 Python 版本构建了包,该版本就必须严格限制为该版本(向上到次要版本)。因此,在本例中,该包是使用 Python 3.10 构建的,但它在元数据中报告它与 Python 3.5+ 的所有版本兼容,这根本不是事实,因为 Conda Python 包将模块安装到 Python 版本中具体site-packages(例如,lib/python-3.10/site-packages/jive)。
--python通常,Python 版本由给定的参数conda-build或文件提供的矩阵控制conda_build_config.yaml(请参阅有关“构建变体”的文档)。
尝试将 调整meta.yaml为类似的内容
package:
name: jive
version: "0.2.1"
source:
path: .
build:
script: python -m pip install --no-deps --ignore-installed .
requirements:
host:
- python
- pip
- setuptools
run:
- python
- numpy
- pandas
- scipy
- seaborn
- matplotlib
- scikit-learn
- statsmodels
- joblib
- bokeh
Run Code Online (Sandbox Code Playgroud)
如果你想在Python 3.9环境中使用它,那么使用conda build --python 3.9 ..
| 归档时间: |
|
| 查看次数: |
5049 次 |
| 最近记录: |