Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

怎么在anaconda虚拟环境里面安装? #20

Open
nistarlwc opened this issue Aug 9, 2023 · 1 comment
Open

怎么在anaconda虚拟环境里面安装? #20

nistarlwc opened this issue Aug 9, 2023 · 1 comment

Comments

@nistarlwc
Copy link

现在得把cuda和NvJpeg都安装到anaconda里方便复制环境。
cuda可以通过conda安装,直接都安装到cuda的虚拟环境里面了。
现在就差这个库怎么安装到cuda的虚拟环境里了。
我尝试修改了代码:

elif platform.system() == 'Windows':
    cuda_include = 'C:\\Anaconda3\\envs\\onnx\\include'
    if platform.machine().endswith('64'):
        cuda_lib = 'C:\\Anaconda3\\envs\\onnx\\Lib\\x64'
    else:
        cuda_lib = 'C:\\Anaconda3\\envs\\onnx\\Lib\\Win32'
    extension_nvjpeg = Extension('nvjpeg', 
        ['nvjpeg-python.cpp', 'src\\x86\\JpegCoder.cpp'], 
        ['include', numpy.get_include(), cuda_include], 
        [('JPEGCODER_ARCH', 'x86')],
        library_dirs=[cuda_lib],
    )

我以为将cuda地址换掉就可以了,python .\setup.py build 是通过了。但是python .\setup.py install报错

C:\Anaconda3\envs\onnx\lib\site-packages\setuptools\_distutils\cmd.py:66: SetuptoolsDeprecationWarning: setup.py install is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` directly.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://blog.ganssle.io/articles/2021/10/setup-py-deprecated.html for details.
        ********************************************************************************

!!
  self.initialize_options()
C:\Anaconda3\envs\onnx\lib\site-packages\setuptools\_distutils\cmd.py:66: EasyInstallDeprecationWarning: easy_install command is deprecated.
!!

        ********************************************************************************
        Please avoid running ``setup.py`` and ``easy_install``.
        Instead, use pypa/build, pypa/installer or other
        standards-based tools.

        See https://github.com/pypa/setuptools/issues/917 for details.
        ********************************************************************************

!!
  self.initialize_options()
warning: no files found matching 'src\**'
zip_safe flag not set; analyzing archive contents...
__pycache__.nvjpeg.cpython-38: module references __file__

@astro-jingtao
Copy link

我也是在虚拟环境安装,使用 pip install -e . 没有遇到这个问题。

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

No branches or pull requests

2 participants