Giter Club home page Giter Club logo

Comments (18)

jsirois avatar jsirois commented on August 17, 2024

I get similar. When I run with -v though I get a hint:

(pex-issues-36)jsirois@gill ~ $ pip list
pex (0.8.3)
pip (6.0.6)
setuptools (7.0)
(pex-issues-36)jsirois@gill ~ $ pex -v -r redis
pex: Failed to translate SourcePackage(u'file:///home/jsirois/.pex/build/redis-2.10.3.tar.gz'): Interpreter /home/jsirois/.pyenv/versions/pex/bin/python not capable of running WheelInstaller
Traceback (most recent call last):
  File "/home/jsirois/.pyenv/versions/pex/bin/pex", line 11, in <module>
    sys.exit(main())
  File "/home/jsirois/.pyenv/versions/pex/lib/python2.7/site-packages/pex/bin/pex.py", line 325, in main
    pex_builder = build_pex(args, options)
  File "/home/jsirois/.pyenv/versions/pex/lib/python2.7/site-packages/pex/bin/pex.py", line 303, in build_pex
    cache_ttl=options.cache_ttl)
  File "/home/jsirois/.pyenv/versions/pex/lib/python2.7/site-packages/pex/resolver.py", line 229, in resolve
    new_requirements.update(requires(highest_package, requirement))
  File "/home/jsirois/.pyenv/versions/pex/lib/python2.7/site-packages/pex/resolver.py", line 201, in requires
    raise Untranslateable('Package %s is not translateable.' % package)
pex.resolver.Untranslateable: Package SourcePackage(u'https://pypi.python.org/packages/source/r/redis/redis-2.10.3.tar.gz#md5=7619221ad0cbd124a5687458ea3f5289') is not translateable.

So: pex: Failed to translate SourcePackage(u'file:///home/jsirois/.pex/build/redis-2.10.3.tar.gz'): Interpreter /home/jsirois/.pyenv/versions/pex/bin/python not capable of running WheelInstaller

That led me to try:

(pex-issues-36)^jsirois@gill ~ $ pex -v --no-wheel -r redis
pex: Resolving distributions: 723.8ms          
pex:     Packaging redis: 165.2ms
  redis 2.10.3
Creating environment PEX.
Running PEX file at /tmp/tmpw27Ich with args []
pex: PEX.run invoking /home/jsirois/.pyenv/versions/pex/bin/python /tmp/tmpw27Ich
Python 2.7.8 (default, Oct 12 2014, 00:37:26) 
[GCC 4.9.1 20140903 (prerelease)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> import redis
>>> dir(redis)
['AuthenticationError', 'BlockingConnectionPool', 'BusyLoadingError', 'Connection', 'ConnectionError', 'ConnectionPool', 'DataError', 'InvalidResponse', 'PubSubError', 'ReadOnlyError', 'Redis', 'RedisError', 'ResponseError', 'SSLConnection', 'StrictRedis', 'TimeoutError', 'UnixDomainSocketConnection', 'VERSION', 'WatchError', '__all__', '__builtins__', '__doc__', '__file__', '__name__', '__package__', '__path__', '__version__', '_compat', 'client', 'connection', 'exceptions', 'from_url', 'lock', 'utils']
>>> 

So this may be at least a workaround for you.

from pex.

wickman avatar wickman commented on August 17, 2024

yeah. we probably need to introduce the pants concept of a python interpreter cache to pex and have it self-bootstrap wheel if it's not found. john's workaround works. also 'pip install wheel' (using the pip associated with that interpreter) will fix it, but we should be doing an equivalent thing for you automatically.

from pex.

wickman avatar wickman commented on August 17, 2024

With #49 does this still happen?

from pex.

sandrotosi avatar sandrotosi commented on August 17, 2024

I'm still facing the same issue with pex 1.0.0:

$ pex --no-use-wheel numpy==1.6.2 -o /usr/scratch/test.pex
Traceback (most recent call last):
  File "/usr/bin/pex", line 9, in <module>
    load_entry_point('pex==1.0.0', 'console_scripts', 'pex')()
  File "/usr/lib/python2.7/dist-packages/pex/bin/pex.py", line 509, in main
    pex_builder = build_pex(reqs, options, resolver_options_builder)
  File "/usr/lib/python2.7/dist-packages/pex/bin/pex.py", line 471, in build_pex
    resolveds = resolver.resolve(resolvables)
  File "/usr/lib/python2.7/dist-packages/pex/resolver.py", line 177, in resolve
    distributions[package] = self.build(package, resolvable.options)
  File "/usr/lib/python2.7/dist-packages/pex/resolver.py", line 228, in build
    dist = super(CachingResolver, self).build(package, options)
  File "/usr/lib/python2.7/dist-packages/pex/resolver.py", line 147, in build
    raise Untranslateable('Package %s is not translateable by %s' % (package, translator))
pex.resolver.Untranslateable: Package SourcePackage('file:///.pex/build/numpy-1.6.2.zip') is not translateable by ChainedTranslator(EggTranslator, SourceTranslator)

from pex.

wickman avatar wickman commented on August 17, 2024

Unable to repro:

mba=tmp=; pex --no-use-wheel numpy==1.6.2 -o /tmp/numpy.pex -v -v -v -v -v
pex: Constructed RequestsContext context <pex.http.RequestsContext object at 0x103225190>                             
pex: Validated numpy-1.6.2.zip (md5=7e13c931985f90efcfa0408f845d6fee)                                                                                        
pex: Validated numpy-1.6.2.zip (md5=7e13c931985f90efcfa0408f845d6fee)
pex: Building pex :: Resolving distributions :: Translating /private/var/folders/rd/_tjz8zts3g14md1kmf38z6w80000gn/T/tmpFRFvy8/numpy-1.6.2.zip into distribution :: Packaging numpy :: Installing /var  numpy 1.6.2tjz8zts3g14md1kmf38z6w80000gn/T/tmp8a9e2N
pex: Building pex: 79742.6ms                                                                                                                                                                                                                                
pex:   Resolving interpreter: 0.2ms
pex:     Setting up interpreter /Users/wickman/Python/CPython-2.7.9/bin/python2.7: 0.2ms
pex:   Resolving distributions: 79329.0ms
pex:     Fetching https://pypi.python.org/packages/source/n/numpy/numpy-1.6.2.zip#md5=7e13c931985f90efcfa0408f845d6fee: 413.1ms
pex:     Fetching file:///Users/wickman/.pex/build/numpy-1.6.2.zip: 6.3ms
pex:       Fetching file:///Users/wickman/.pex/build/numpy-1.6.2.zip: 5.4ms
pex:     Translating /private/var/folders/rd/_tjz8zts3g14md1kmf38z6w80000gn/T/tmpFRFvy8/numpy-1.6.2.zip into distribution: 78293.5ms
pex:       Packaging numpy: 77683.5ms
pex:         Installing /var/folders/rd/_tjz8zts3g14md1kmf38z6w80000gn/T/tmp8a9e2N: 77664.7ms
Saving PEX file to /tmp/numpy.pex

Could you add some -v -v -v to see where things are getting tripped up? numpy is a challenging and finicky dep to package.

from pex.

sandrotosi avatar sandrotosi commented on August 17, 2024

are you using 1.0.0 or anothe version? I will get back with the -v -v -v as soon as I will have access again to the machine

from pex.

wickman avatar wickman commented on August 17, 2024

This was with 1.0.0.

from pex.

sandrotosi avatar sandrotosi commented on August 17, 2024

ok, failure is:

    Atlas (http://math-atlas.sourceforge.net/) libraries not found.
    Directories to search for the libraries can be specified in the
    numpy/distutils/site.cfg file (section [atlas]) or by setting
    the ATLAS environment variable.
  warnings.warn(AtlasNotFoundError.**doc**)
/tmp/tmpgcnkhy5v/numpy-1.6.2/build/py3k/numpy/distutils/system_info.py:1340: UserWarning: 
    Atlas (http://math-atlas.sourceforge.net/) libraries not found.
    Directories to search for the libraries can be specified in the
    numpy/distutils/site.cfg file (section [atlas]) or by setting
    the ATLAS environment variable.
  warnings.warn(AtlasNotFoundError.**doc**)
error: Command "x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -g -fstack-protector-strong -Wformat -Werror=format-security -D_FORTIFY_SOURCE=2 -fPIC -Inumpy/core/include -Ibuild/src.linux-x86_64-3.4/numpy/core/include/numpy -Inumpy/core/src/private -Inumpy/core/src -Inumpy/core -Inumpy/core/src/npymath -Inumpy/core/src/multiarray -Inumpy/core/src/umath -Inumpy/core/include -I/usr/include/python3.4m -Ibuild/src.linux-x86_64-3.4/numpy/core/src/multiarray -Ibuild/src.linux-x86_64-3.4/numpy/core/src/umath -c numpy/core/src/multiarray/multiarraymodule_onefile.c -o build/temp.linux-x86_64-3.4/numpy/core/src/multiarray/multiarraymodule_onefile.o" failed with exit status 1

pex: Failed to install package at /tmp/tmpgcnkhy5v/numpy-1.6.2: Failed to install /tmp/tmpgcnkhy5v/numpy-1.6.2  
Traceback (most recent call last):
  File "/usr/bin/pex", line 9, in <module>
    load_entry_point('pex==1.0.0', 'console_scripts', 'pex')()
  File "/usr/lib/python3/dist-packages/pex/bin/pex.py", line 509, in main
    pex_builder = build_pex(reqs, options, resolver_options_builder)
  File "/usr/lib/python3/dist-packages/pex/bin/pex.py", line 471, in build_pex
    resolveds = resolver.resolve(resolvables)
  File "/usr/lib/python3/dist-packages/pex/resolver.py", line 177, in resolve
    distributions[package] = self.build(package, resolvable.options)
  File "/usr/lib/python3/dist-packages/pex/resolver.py", line 228, in build
    dist = super(CachingResolver, self).build(package, options)
  File "/usr/lib/python3/dist-packages/pex/resolver.py", line 147, in build
    raise Untranslateable('Package %s is not translateable by %s' % (package, translator))
pex.resolver.Untranslateable: Package SourcePackage('file:///home/morph/.pex/build/numpy-1.6.2.zip') is not translateable by ChainedTranslator(WheelTranslator, EggTranslator, SourceTranslator)

when building the Debian package infact we export ATLAS=None as we support only blas, how can we set the same with pex? I tried "export ATLAS=None ; pex -v -v -v numpy==1.6.2 -o /tmp/test.pex" but didnt work

from pex.

nichochar avatar nichochar commented on August 17, 2024

I'm running into a similar issue, with an extension to pex that integrates spark. But this is I believe the pex issue described above:

spex -vvvvv --distro --spark-home spark/spark apple_epf ./
pex: Constructed RequestsContext context <pex.http.RequestsContext object at 0x1033ab090>
pex: Constructed RequestsContext context <pex.http.RequestsContext object at 0x1033ab810>
pex: Constructed RequestsContext context <pex.http.RequestsContext object at 0x1033abdd0>
pex: Constructed RequestsContext context <pex.http.RequestsContext object at 0x1033abc50>
pex: Constructed RequestsContext context <pex.http.RequestsContext object at 0x1033abc10>
pex: Constructed RequestsContext context <pex.http.RequestsContext object at 0x1036000d0>
pex: Building spex :: Building pex :: Resolving distributions :: Fetching file:///Users/nicholas/URX/dev/apple-epf-processor/.pex/build/tornado-4.2.tar.gz :: Fetching file:///Users/pex: Building spex :: Building pex :: Resolving distributions :: Translating /private/var/folders/mv/1zl7fz216y37lh1xlpvr8mth0000gn/T/tmpqSzKAM/tornado-4.2.tar.gz into distribution pex: Building spex :: Building pex :: Resolving distributions :: Translating /private/var/folders/mv/1zl7fz216y37lh1xlpvr8mth0000gn/T/tmpqSzKAM/tornado-4.2.tar.gz into distribution pex: Building spex :: Building pex :: Resolving distributions :: Translating /private/var/folders/mv/1zl7fz216y37lh1xlpvr8mth0000gn/T/tmpqSzKAM/tornado-4.2.tar.gz into distribution Traceback (most recent call last): /var/folders/mv/1zl7fz216y37lh1xlpvr8mth0000gn/T/tmpa5z6bk
  File "/Users/nicholas/URX/dev/apple-epf-processor/cunt/bin/spex", line 9, in <module>
    load_entry_point('spex==0.1.0', 'console_scripts', 'spex')()
  File "/Users/nicholas/URX/dev/apple-epf-processor/cunt/lib/python2.7/site-packages/spex/bin/spex.py", line 336, in main
    pex_builder = build_pex(args)
  File "/Users/nicholas/URX/dev/apple-epf-processor/cunt/lib/python2.7/site-packages/spex/bin/spex.py", line 228, in build_pex
    resolveds = resolver.resolve(resolvables)
  File "/Users/nicholas/URX/dev/apple-epf-processor/cunt/lib/python2.7/site-packages/pex/resolver.py", line 191, in resolve
    dist = self.build(package, resolvable.options)
  File "/Users/nicholas/URX/dev/apple-epf-processor/cunt/lib/python2.7/site-packages/pex/resolver.py", line 248, in build
    dist = super(CachingResolver, self).build(package, options)
  File "/Users/nicholas/URX/dev/apple-epf-processor/cunt/lib/python2.7/site-packages/pex/resolver.py", line 162, in build
    raise Untranslateable('Could not get distribution for %s on appropriate platform.' % package)
pex.resolver.Untranslateable: Could not get distribution for SourcePackage('file:///Users/nicholas/URX/dev/apple-epf-processor/.pex/build/tornado-4.2.tar.gz') on appropriate platform.

Edit: i'm running this on osx, when I run it on a linux, it goes through no problem, so it's platform specific. (setuptools 15.2 used in both cases)

from pex.

wickman avatar wickman commented on August 17, 2024

@nichochar Is your wrapper script specifying --platform=linux-x86_64 or not specifying a platform? It's possible that it failed to build for OS X but found a binary distribution for a different platform (hence the "on appropriate platform" part.)

@sandrotosi have you tried building an egg or whl and using -f to point to it? this could be a way around the problem, though I'm surprised that it would build with pip and not with pex.

from pex.

jsirois avatar jsirois commented on August 17, 2024

@sandrotosi and @wickman - this is specifically a python 3 issue. I repo @sandrotosi's problem under pex building for 3 - it appears the running of 2to3 against the numpy sources somehow clobbers the ATLAS=None env var. This though works for me: ATLAS=None pex --python=python2 --no-use-wheel numpy==1.6.2 -o numpy.pex.

from pex.

offby1 avatar offby1 commented on August 17, 2024

I don't know if this adds anything to the discussion, but here's a similar and easy-to-repro error (pex 1.1.0, python 3, OS X):

**** Failed to install MarkupSafe-0.23. stdout:
running bdist_wheel
running build
running build_py
creating build
creating build/lib.macosx-10.10-x86_64-3.5
creating build/lib.macosx-10.10-x86_64-3.5/markupsafe
copying markupsafe/__init__.py -> build/lib.macosx-10.10-x86_64-3.5/markupsafe
copying markupsafe/_compat.py -> build/lib.macosx-10.10-x86_64-3.5/markupsafe
copying markupsafe/_constants.py -> build/lib.macosx-10.10-x86_64-3.5/markupsafe
copying markupsafe/_native.py -> build/lib.macosx-10.10-x86_64-3.5/markupsafe
copying markupsafe/tests.py -> build/lib.macosx-10.10-x86_64-3.5/markupsafe
running egg_info
writing dependency_links to MarkupSafe.egg-info/dependency_links.txt
writing MarkupSafe.egg-info/PKG-INFO
writing top-level names to MarkupSafe.egg-info/top_level.txt
reading manifest file 'MarkupSafe.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'MarkupSafe.egg-info/SOURCES.txt'
copying markupsafe/_speedups.c -> build/lib.macosx-10.10-x86_64-3.5/markupsafe
running build_ext
building 'markupsafe._speedups' extension
creating build/temp.macosx-10.10-x86_64-3.5
creating build/temp.macosx-10.10-x86_64-3.5/markupsafe
clang -Wno-unused-result -Wsign-compare -Wunreachable-code -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/usr/local/include -I/usr/local/opt/openssl/include -I/usr/local/opt/sqlite/include -I/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/include/python3.5m -c markupsafe/_speedups.c -o build/temp.macosx-10.10-x86_64-3.5/markupsafe/_speedups.o
clang -bundle -undefined dynamic_lookup build/temp.macosx-10.10-x86_64-3.5/markupsafe/_speedups.o -L/usr/local/lib -L/usr/local/opt/openssl/lib -L/usr/local/opt/sqlite/lib -o build/lib.macosx-10.10-x86_64-3.5/markupsafe/_speedups.cpython-35m-darwin.so
installing to build/bdist.macosx-10.10-x86_64/wheel
running install
running install_lib
creating build/bdist.macosx-10.10-x86_64
creating build/bdist.macosx-10.10-x86_64/wheel
creating build/bdist.macosx-10.10-x86_64/wheel/markupsafe
copying build/lib.macosx-10.10-x86_64-3.5/markupsafe/__init__.py -> build/bdist.macosx-10.10-x86_64/wheel/markupsafe
copying build/lib.macosx-10.10-x86_64-3.5/markupsafe/_compat.py -> build/bdist.macosx-10.10-x86_64/wheel/markupsafe
copying build/lib.macosx-10.10-x86_64-3.5/markupsafe/_constants.py -> build/bdist.macosx-10.10-x86_64/wheel/markupsafe
copying build/lib.macosx-10.10-x86_64-3.5/markupsafe/_native.py -> build/bdist.macosx-10.10-x86_64/wheel/markupsafe
copying build/lib.macosx-10.10-x86_64-3.5/markupsafe/_speedups.c -> build/bdist.macosx-10.10-x86_64/wheel/markupsafe
copying build/lib.macosx-10.10-x86_64-3.5/markupsafe/_speedups.cpython-35m-darwin.so -> build/bdist.macosx-10.10-x86_64/wheel/markupsafe
copying build/lib.macosx-10.10-x86_64-3.5/markupsafe/tests.py -> build/bdist.macosx-10.10-x86_64/wheel/markupsafe
running install_egg_info
Copying MarkupSafe.egg-info to build/bdist.macosx-10.10-x86_64/wheel/MarkupSafe-0.23-py3.5.egg-info
running install_scripts

**** Failed to install MarkupSafe-0.23. stderr:
Traceback (most recent call last):
  File "<stdin>", line 7, in <module>
  File "setup.py", line 120, in <module>
    try_building_extension()
  File "setup.py", line 99, in try_building_extension
    run_setup(True)
  File "setup.py", line 93, in run_setup
    ext_modules=ext_modules,
  File "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/core.py", line 148, in setup
    dist.run_commands()
  File "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/dist.py", line 955, in run_commands
    self.run_command(cmd)
  File "/usr/local/Cellar/python3/3.5.0/Frameworks/Python.framework/Versions/3.5/lib/python3.5/distutils/dist.py", line 974, in run_command
    cmd_obj.run()
  File "/Users/erichanchrow/.pex/interpreters/CPython-3.5.0/wheel-0.24.0-py3.5.egg/wheel/bdist_wheel.py", line 213, in run
  File "/Users/erichanchrow/.pex/interpreters/CPython-3.5.0/wheel-0.24.0-py3.5.egg/wheel/bdist_wheel.py", line 161, in get_archive_basename
  File "/Users/erichanchrow/.pex/interpreters/CPython-3.5.0/wheel-0.24.0-py3.5.egg/wheel/bdist_wheel.py", line 155, in get_tag
AssertionError

Traceback (most recent call last):
  File ".bootstrap/_pex/pex.py", line 317, in execute
  File ".bootstrap/_pex/pex.py", line 250, in _wrap_coverage
  File ".bootstrap/_pex/pex.py", line 282, in _wrap_profiling
  File ".bootstrap/_pex/pex.py", line 360, in _execute
  File ".bootstrap/_pex/pex.py", line 418, in execute_entry
  File ".bootstrap/_pex/pex.py", line 436, in execute_pkg_resources
  File "/Users/erichanchrow/.pex/install/pex-1.1.0-py2.py3-none-any.whl.dd5c6332261801519b3da9e69aebe08bda58ecab/pex-1.1.0-py2.py3-none-any.whl/pex/bin/pex.py", line 509, in main
    pex_builder = build_pex(reqs, options, resolver_options_builder)
  File "/Users/erichanchrow/.pex/install/pex-1.1.0-py2.py3-none-any.whl.dd5c6332261801519b3da9e69aebe08bda58ecab/pex-1.1.0-py2.py3-none-any.whl/pex/bin/pex.py", line 471, in build_pex
    resolveds = resolver.resolve(resolvables)
  File "/Users/erichanchrow/.pex/install/pex-1.1.0-py2.py3-none-any.whl.dd5c6332261801519b3da9e69aebe08bda58ecab/pex-1.1.0-py2.py3-none-any.whl/pex/resolver.py", line 199, in resolve
    dist = self.build(package, resolvable.options)
  File "/Users/erichanchrow/.pex/install/pex-1.1.0-py2.py3-none-any.whl.dd5c6332261801519b3da9e69aebe08bda58ecab/pex-1.1.0-py2.py3-none-any.whl/pex/resolver.py", line 256, in build
    dist = super(CachingResolver, self).build(package, options)
  File "/Users/erichanchrow/.pex/install/pex-1.1.0-py2.py3-none-any.whl.dd5c6332261801519b3da9e69aebe08bda58ecab/pex-1.1.0-py2.py3-none-any.whl/pex/resolver.py", line 168, in build
    raise Untranslateable('Package %s is not translateable by %s' % (package, translator))
pex.resolver.Untranslateable: Package SourcePackage('file:///Users/erichanchrow/.pex/build/MarkupSafe-0.23.tar.gz') is not translateable by ChainedTranslator(WheelTranslator, EggTranslator, SourceTranslator)

from pex.

trivigy avatar trivigy commented on August 17, 2024

Anyone ever came up with a solution for this? Having the same problem.

pex scipy==0.18.1 -o newfile.pex --python=python3.5 -v -v -v -v -v
...
creating build/temp.linux-x86_64-3.5/scipy/linalg
creating build/temp.linux-x86_64-3.5/usr
creating build/temp.linux-x86_64-3.5/usr/local
creating build/temp.linux-x86_64-3.5/usr/local/lib
creating build/temp.linux-x86_64-3.5/usr/local/lib/python3.5
creating build/temp.linux-x86_64-3.5/usr/local/lib/python3.5/dist-packages
creating build/temp.linux-x86_64-3.5/usr/local/lib/python3.5/dist-packages/scipy
creating build/temp.linux-x86_64-3.5/usr/local/lib/python3.5/dist-packages/scipy/_build_utils
creating build/temp.linux-x86_64-3.5/usr/local/lib/python3.5/dist-packages/scipy/_build_utils/src
compile options: '-I/usr/local/lib/python3.5/dist-packages/numpy/core/include -I/usr/include/python3.5m -I/usr/include/python3.5m -I/usr/local/lib/python3.5/dist-packages/numpy/core/include -c'

stderr:
Running from scipy source directory.
/usr/local/lib/python3.5/dist-packages/numpy/distutils/system_info.py:639: UserWarning: Specified path /usr/local/include/python3.5m is invalid.
  warnings.warn('Specified path %s is invalid.' % d)
"object of type 'type' has no len()" in evaluating 'len(list)' (available names: [])
"object of type 'type' has no len()" in evaluating 'len(list)' (available names: [])
"object of type 'type' has no len()" in evaluating 'len(list)' (available names: [])
"object of type 'type' has no len()" in evaluating 'len(list)' (available names: [])
"object of type 'type' has no len()" in evaluating 'len(list)' (available names: [])
"object of type 'type' has no len()" in evaluating 'len(list)' (available names: [])
error: [Errno 2] No such file or directory: '/usr/local/lib/python3.5/dist-packages/scipy/_build_utils/src/wrap_dummy_g77_abi.f'


pex: Failed to install package at /tmp/tmp7hatursc/scipy-0.18.1: Failed to install /tmp/tmp7hatursc/scipy-0.18.1                                                 
Traceback (most recent call last):
  File "/usr/local/bin/pex", line 11, in <module>
    sys.exit(main())
  File "/usr/local/lib/python3.5/dist-packages/pex/bin/pex.py", line 540, in main
    pex_builder = build_pex(reqs, options, resolver_options_builder)
  File "/usr/local/lib/python3.5/dist-packages/pex/bin/pex.py", line 489, in build_pex
    resolveds = resolver.resolve(resolvables)
  File "/usr/local/lib/python3.5/dist-packages/pex/resolver.py", line 200, in resolve
    dist = self.build(package, resolvable.options)
  File "/usr/local/lib/python3.5/dist-packages/pex/resolver.py", line 257, in build
    dist = super(CachingResolver, self).build(package, options)
  File "/usr/local/lib/python3.5/dist-packages/pex/resolver.py", line 168, in build
    raise Untranslateable('Package %s is not translateable by %s' % (package, translator))
pex.resolver.Untranslateable: Package SourcePackage('file:///home/trivigy/.pex/build/scipy-0.18.1.zip') is not translateable by ChainedTranslator(WheelTranslator, EggTranslator, SourceTranslator)

from pex.

snyaggarwal avatar snyaggarwal commented on August 17, 2024

Getting this issue with python3:
pex.resolver.Untranslateable: Package SourcePackage('file:///root/.pex/build/pandas-0.19.2.tar.gz') is not translateable by ChainedTranslator(WheelTranslator, EggTranslator, SourceTranslator)

Any updates on this?

from pex.

kylieCat avatar kylieCat commented on August 17, 2024

Also receiving this error with Python 3. Using version 1.2.0.

[Build todo-k8s]                FAILURE�[0mException caught: (<class 'pex.resolver.Untranslateable'>)
[Build todo-k8s]   File "/home/ubuntu/.cache/pants/setup/bootstrap-Linux-x86_64/1.2.0/bin/pants", line 11, in <module>
[Build todo-k8s]     sys.exit(main())
[Build todo-k8s]   File "/home/ubuntu/.cache/pants/setup/bootstrap-Linux-x86_64/pants.otzxCk/install/local/lib/python2.7/site-packages/pants/bin/pants_exe.py", line 44, in main
[Build todo-k8s]     PantsRunner(exiter).run()
[Build todo-k8s]   File "/home/ubuntu/.cache/pants/setup/bootstrap-Linux-x86_64/pants.otzxCk/install/local/lib/python2.7/site-packages/pants/bin/pants_runner.py", line 57, in run
[Build todo-k8s]     options_bootstrapper=options_bootstrapper)
[Build todo-k8s]   File "/home/ubuntu/.cache/pants/setup/bootstrap-Linux-x86_64/pants.otzxCk/install/local/lib/python2.7/site-packages/pants/bin/pants_runner.py", line 46, in _run
[Build todo-k8s]     return LocalPantsRunner(exiter, args, env, options_bootstrapper=options_bootstrapper).run()
[Build todo-k8s]   File "/home/ubuntu/.cache/pants/setup/bootstrap-Linux-x86_64/pants.otzxCk/install/local/lib/python2.7/site-packages/pants/bin/local_pants_runner.py", line 53, in run
[Build todo-k8s]     self._maybe_profiled(self._run)
[Build todo-k8s]   File "/home/ubuntu/.cache/pants/setup/bootstrap-Linux-x86_64/pants.otzxCk/install/local/lib/python2.7/site-packages/pants/bin/local_pants_runner.py", line 50, in _maybe_profiled
[Build todo-k8s]     runner()
[Build todo-k8s]   File "/home/ubuntu/.cache/pants/setup/bootstrap-Linux-x86_64/pants.otzxCk/install/local/lib/python2.7/site-packages/pants/bin/local_pants_runner.py", line 95, in _run
[Build todo-k8s]     goal_runner_result = goal_runner.run()
[Build todo-k8s]   File "/home/ubuntu/.cache/pants/setup/bootstrap-Linux-x86_64/pants.otzxCk/install/local/lib/python2.7/site-packages/pants/bin/goal_runner.py", line 268, in run
[Build todo-k8s]     result = self._execute_engine()
[Build todo-k8s]   File "/home/ubuntu/.cache/pants/setup/bootstrap-Linux-x86_64/pants.otzxCk/install/local/lib/python2.7/site-packages/pants/bin/goal_runner.py", line 257, in _execute_engine
[Build todo-k8s]     result = engine.execute(self._context, self._goals)
[Build todo-k8s]   File "/home/ubuntu/.cache/pants/setup/bootstrap-Linux-x86_64/pants.otzxCk/install/local/lib/python2.7/site-packages/pants/engine/legacy_engine.py", line 26, in execute
[Build todo-k8s]     self.attempt(context, goals)
[Build todo-k8s]   File "/home/ubuntu/.cache/pants/setup/bootstrap-Linux-x86_64/pants.otzxCk/install/local/lib/python2.7/site-packages/pants/engine/round_engine.py", line 224, in attempt
[Build todo-k8s]     goal_executor.attempt(explain)
[Build todo-k8s]   File "/home/ubuntu/.cache/pants/setup/bootstrap-Linux-x86_64/pants.otzxCk/install/local/lib/python2.7/site-packages/pants/engine/round_engine.py", line 47, in attempt
[Build todo-k8s]     task.execute()
[Build todo-k8s]   File "/home/ubuntu/.cache/pants/setup/bootstrap-Linux-x86_64/pants.otzxCk/install/local/lib/python2.7/site-packages/pants/backend/python/tasks/python_binary_create.py", line 59, in execute
[Build todo-k8s]     self.create_binary(vt.target, vt.results_dir)
[Build todo-k8s]   File "/home/ubuntu/.cache/pants/setup/bootstrap-Linux-x86_64/pants.otzxCk/install/local/lib/python2.7/site-packages/pants/backend/python/tasks/python_binary_create.py", line 82, in create_binary
[Build todo-k8s]     platforms=binary.platforms) as chroot:
[Build todo-k8s]   File "/usr/lib/python2.7/contextlib.py", line 17, in __enter__
[Build todo-k8s]     return self.gen.next()
[Build todo-k8s]   File "/home/ubuntu/.cache/pants/setup/bootstrap-Linux-x86_64/pants.otzxCk/install/local/lib/python2.7/site-packages/pants/backend/python/tasks/python_task.py", line 175, in temporary_chroot
[Build todo-k8s]     extra_requirements, executable_file_content)
[Build todo-k8s]   File "/home/ubuntu/.cache/pants/setup/bootstrap-Linux-x86_64/pants.otzxCk/install/local/lib/python2.7/site-packages/pants/backend/python/tasks/python_task.py", line 190, in _build_chroot
[Build todo-k8s]     chroot.dump()
[Build todo-k8s]   File "/home/ubuntu/.cache/pants/setup/bootstrap-Linux-x86_64/pants.otzxCk/install/local/lib/python2.7/site-packages/pants/backend/python/python_chroot.py", line 227, in dump
[Build todo-k8s]     distributions = self._resolve_multi(reqs_to_build, find_links)
[Build todo-k8s]   File "/home/ubuntu/.cache/pants/setup/bootstrap-Linux-x86_64/pants.otzxCk/install/local/lib/python2.7/site-packages/pants/backend/python/python_chroot.py", line 266, in _resolve_multi
[Build todo-k8s]     cache_ttl=self._python_setup.resolver_cache_ttl)
[Build todo-k8s]   File "/home/ubuntu/.cache/pants/setup/bootstrap-Linux-x86_64/pants.otzxCk/install/local/lib/python2.7/site-packages/pex/resolver.py", line 346, in resolve
[Build todo-k8s]     return resolver.resolve(resolvables_from_iterable(requirements, builder))
[Build todo-k8s]   File "/home/ubuntu/.cache/pants/setup/bootstrap-Linux-x86_64/pants.otzxCk/install/local/lib/python2.7/site-packages/pex/resolver.py", line 200, in resolve
[Build todo-k8s]     dist = self.build(package, resolvable.options)
[Build todo-k8s]   File "/home/ubuntu/.cache/pants/setup/bootstrap-Linux-x86_64/pants.otzxCk/install/local/lib/python2.7/site-packages/pex/resolver.py", line 257, in build
[Build todo-k8s]     dist = super(CachingResolver, self).build(package, options)
[Build todo-k8s]   File "/home/ubuntu/.cache/pants/setup/bootstrap-Linux-x86_64/pants.otzxCk/install/local/lib/python2.7/site-packages/pex/resolver.py", line 168, in build
[Build todo-k8s]     raise Untranslateable('Package %s is not translateable by %s' % (package, translator))
[Build todo-k8s] 
[Build todo-k8s] Exception message: Package SourcePackage(u'file:///home/ubuntu/workspace/build3/monorepo/.pants.d/python-setup/resolved_requirements/CPython-3.5.2/grpcio-1.3.5.tar.gz') is not translateable by ChainedTranslator(WheelTranslator, EggTranslator, SourceTranslator)

from pex.

sitaktif avatar sitaktif commented on August 17, 2024

Having the same issue here on OS X python3.6, where my project is using a virtual env set up using the python3.6 installer from python.org.

The wheels package is installed in my virtualenv, but it is not installed on my system python. I noticed that the error mentions the use of /Library/Frameworks/Python.framework/Versions/3.6/bin/python3.6 instead of /path/to/my/project/.venv/bin/python3.6.

Running pip3 install wheel on my system python (not in the virtualenv) works around the issue for me.

It seems like it is a bug due to pex to dereferencing the python virtualenv interpreter symlink, ignoring the packages installed in the virtualenv:

$ ls .venv/bin/ -al
[...]
lrwxr-xr-x  1 sitaktif staff    7 Jul  2 08:39 python -> python3
lrwxr-xr-x  1 sitaktif staff   61 Jul  2 08:39 python3 -> /Library/Frameworks/Python.framework/Versions/3.6/bin/python3
[...]

from pex.

sitaktif avatar sitaktif commented on August 17, 2024

I can't author a PR for silly legal reasons, but here is a change that fixes the issue in my case:

diff --git a/pex/interpreter.py b/pex/interpreter.py
index d7fd3f0..fcf2c9c 100644
--- a/pex/interpreter.py
+++ b/pex/interpreter.py
@@ -355,7 +355,7 @@ class PythonInterpreter(object):
        :param extras: A mapping from (dist.key, dist.version) to dist.location
                       of the extras associated with this interpreter.
     """
-    self._binary = os.path.realpath(binary)
+    self._binary = os.path.abspath(binary)
     self._extras = extras or {}
     self._identity = identity

from pex.

kwlzn avatar kwlzn commented on August 17, 2024

noting that I'm no longer able to repro any of the cases mentioned here for either 2.7 or 3.6:

[omerta ~]$ pex redis==2.10.3 numpy==1.6.2 MarkupSafe==0.23
Python 2.7.13 (default, Mar  2 2017, 16:22:01)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>>
[omerta ~]$ pex pandas==0.19.2 grpcio==1.3.5 scipy==0.18.1
Python 3.6.0 (default, Feb 13 2017, 11:02:15)
[GCC 4.2.1 Compatible Apple LLVM 8.0.0 (clang-800.0.42.1)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>>

also, as of 1.2.8 pex now declares it's own transitive requirement on wheel, so it should be automatically included in the calling pex installation environment going forward obviating the need to source this from e.g. a venv.

marking as resolved.

from pex.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.