当我尝试构建时,我收到错误:
ImportError: cannot import name shared
以下是完整的错误日志:
File "/Users/Apple/Downloads/emsdk_portable/emscripten/1.30.0/emconfigure", line 21, in <module>
from tools import shared
ImportError: cannot import name shared
Traceback (most recent call last):
File "/Users/Apple/Downloads/emsdk_portable/emscripten/1.30.0/emmake", line 22, in <module>
from tools import shared
ImportError: cannot import name shared
mv: rename src/ngspice to src/ngspice.bc: No such file or directory
Traceback (most recent call last):
File "/Users/Apple/Downloads/emsdk_portable/emscripten/1.30.0/emcc", line 52, in <module>
from tools import shared, jsrun, system_libs
ImportError: cannot import name shared
以下是我安装名称共享的工具的方法:
bash-3.2$ pip install tools
Downloading/unpacking tools
Downloading tools-0.1.9.tar.gz
Running setup.py (path:/private/var/folders/8g/p8wtd8g17z973rpjrz5dx4_h0000gn/T/pip_build_Apple/tools/setup.py) egg_info for package tools
Downloading/unpacking pytils (from tools)
Downloading pytils-0.3.tar.gz (89kB): 89kB downloaded
Running setup.py (path:/private/var/folders/8g/p8wtd8g17z973rpjrz5dx4_h0000gn/T/pip_build_Apple/pytils/setup.py) egg_info for package pytils
warning: no files found matching 'README'
Requirement already satisfied (use --upgrade to upgrade): six in /Applications/djangostack-1.7.8-0/python/lib/python2.7/site-packages/six-1.7.3-py2.7.egg (from tools)
Requirement already satisfied (use --upgrade to upgrade): lxml in /Applications/djangostack-1.7.8-0/python/lib/python2.7/site-packages/lxml-3.2.3-py2.7-macosx-10.5-x86_64.egg (from tools)
Installing collected packages: tools, pytils
Running setup.py install for tools
Running setup.py install for pytils
warning: no files found matching 'README'
Successfully installed tools pytils
Cleaning up...
这个问题是否与python的当前安装(2.7)有关?
修改
bash-3.2$ which pip
/Applications/djangostack-1.7.8-0/python/bin/pip
bash-3.2$ which python
/Applications/djangostack-1.7.8-0/python/bin/python
编辑2
我正在尝试编译:{{1}},其中包含:
emcc - compiler helper script
我正在尝试使用Emscripten将c ++库编译成javascript
编辑3
上面的代码存储在import os, sys, shutil, tempfile, subprocess, shlex, time, re, logging
from subprocess import PIPE
from tools import shared, jsrun, system_libs
from tools.shared import Compression, execute, suffix, unsuffixed, unsuffixed_basename, WINDOWS, safe_move
from tools.response_file import read_response_file
我目前的目录是:
~/Downloads/emsdk_portable/emscripten/1.30.0/emcc
https://github.com/concord-consortium/build-ngspice-js
编辑4
如果我卸载工具,这就是我得到的:
$ pwd
/Users/Apple/Documents/projects/myproject/ngspice/release