gpt4 book ai didi

python - 如何为makerbot/s3g设置虚拟环境

转载 作者:行者123 更新时间:2023-12-01 05:04:36 25 4
gpt4 key购买 nike

我正在尝试让这个模块工作:

https://github.com/makerbot/s3g

它们的命名有点令人困惑,因为整个东西通常被称为“makerbot_driver”,并且还有一个子文件夹称为该文件夹。

当我尝试运行命令时遇到麻烦:

python virtualenv.py virtualenv

当我尝试在makerbot_driver文件夹中运行它时,正如他们建议的那样,我得到了这个:

python: can't open file 'virtualenv.py': [Errno 2] No such file or directory

这是有道理的,因为 virtualenv.py 实际上是上一个文件夹。然而,当我向上一个文件夹并运行相同的命令时,它取得了更大的成功,但遇到了一堆我似乎无法解释的错误:

New python executable in virtualenv/bin/python
Installing setuptools...................................
Complete output from command /home/jason/GitHub/s3g/virtualenv/bin/python -c "#!python
\"\"\"Bootstra...sys.argv[1:])






" /home/jason/GitHub/s...ols-0.6c11-py2.7.egg:
Traceback (most recent call last):
File "<string>", line 279, in <module>
File "<string>", line 240, in main
File "/home/jason/GitHub/s3g/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 1712, in main
File "/home/jason/GitHub/s3g/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 1700, in with_ei_usage
File "/home/jason/GitHub/s3g/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 1716, in <lambda>
File "/usr/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/usr/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib/python2.7/distutils/dist.py", line 971, in run_command
cmd_obj.ensure_finalized()
File "/usr/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
self.finalize_options()
File "/home/jason/GitHub/s3g/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 125, in finalize_options
File "/home/jason/GitHub/s3g/setuptools-0.6c11-py2.7.egg/setuptools/command/easy_install.py", line 1121, in _expand
File "/usr/lib/python2.7/distutils/cmd.py", line 312, in get_finalized_command
cmd_obj.ensure_finalized()
File "/usr/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
self.finalize_options()
File "/home/jason/GitHub/s3g/setuptools-0.6c11-py2.7.egg/setuptools/command/install.py", line 32, in finalize_options
File "/usr/lib/python2.7/distutils/command/install.py", line 321, in finalize_options
(prefix, exec_prefix) = get_config_vars('prefix', 'exec_prefix')
File "/home/jason/GitHub/s3g/virtualenv/lib/python2.7/distutils/__init__.py", line 88, in sysconfig_get_config_vars
real_vars = old_get_config_vars(*args)
File "/usr/lib/python2.7/distutils/sysconfig.py", line 495, in get_config_vars
func()
File "/usr/lib/python2.7/distutils/sysconfig.py", line 439, in _init_posix
from _sysconfigdata import build_time_vars
File "/usr/lib/python2.7/_sysconfigdata.py", line 6, in <module>
from _sysconfigdata_nd import *
ImportError: No module named _sysconfigdata_nd
----------------------------------------
...Installing setuptools...done.
Traceback (most recent call last):
File "virtualenv.py", line 2270, in <module>
main()
File "virtualenv.py", line 928, in main
never_download=options.never_download)
File "virtualenv.py", line 1040, in create_environment
search_dirs=search_dirs, never_download=never_download)
File "virtualenv.py", line 593, in install_setuptools
search_dirs=search_dirs, never_download=never_download)
File "virtualenv.py", line 567, in _install_req
cwd=cwd)
File "virtualenv.py", line 1006, in call_subprocess
% (cmd_desc, proc.returncode))
OSError: Command /home/jason/GitHub/s3g/virtualenv/bin/python -c "#!python
\"\"\"Bootstra...sys.argv[1:])






" /home/jason/GitHub/s...ols-0.6c11-py2.7.egg failed with error code 1

我尝试安装他们需要的 pyserial 模块和 virtualenv 之类的东西,结果一切都很好,但是这个 virtualenv 的东西对我来说一直很糟糕。

如有任何建议,我们将不胜感激。谢谢。

最佳答案

这是 Ubuntu 中的一个已知错误。修复:

$ cd /usr/lib/python2.7
$ sudo ln -s plat-x86_64-linux-gnu/_sysconfigdata_nd.py .

然后就可以了。

$ python2.7 virtualenv.py virtualenv
New python executable in virtualenv/bin/python2.7
Not overwriting existing python script virtualenv/bin/python (you must use virtualenv/bin/python2.7)
Installing setuptools................................done.
Installing pip.....................done.

关于python - 如何为makerbot/s3g设置虚拟环境,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25304223/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com