我正在尝试使此模块正常工作:
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/