question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

pip installation of py-mini-racer fails

See original GitHub issue

Greetings from Vietnam,

Steps to reproduce

I am running FreeBSD 10.4 with latest updates, and want to install PyMiniRacer as a dependency inside a FreeBSD jail inside a Python 3.6.5 virtual environment. I have installed bash (FreeBSD uses csh by default), as PyMiniRacer seems to depend on it. pip version is 9.0.3; an upgrade to pip version 10.0.1 does not make any difference. After clearing the pip cache, I run from inside the virtual environment:

pip install py-mini-racer

Expected behavior

pip should download and cleanly install PyMiniRacer inside the virtual environment.

Actual behavior

Core error message:

    DEBUG:py_mini_racer.extension.v8_build:Calling: 'fetch v8' from working directory /tmp/pip-build-2jgmbfjh/py-mini-racer/py_mini_racer/extension/v8
      File "/tmp/pip-build-2jgmbfjh/py-mini-racer/vendor/depot_tools/fetch.py", line 65
        print 'Running: %s' % (' '.join(pipes.quote(x) for x in cmd))
                          ^
    SyntaxError: invalid syntax

Full error message:

(wq) [root@www_py /usr/local/wq]# pip install py-mini-racer
Collecting py-mini-racer
  Downloading https://files.pythonhosted.org/packages/6a/1c/63e74d75cee304e4c534b95e848a45bbd9ef114cc9895dca162206ec29d6/py_mini_racer-0.1.15.tar.gz (327kB)
    100% |████████████████████████████████| 337kB 3.4MB/s 
Installing collected packages: py-mini-racer
  Running setup.py install for py-mini-racer ... error
    Complete output from command /usr/local/wq/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-4d1f5b6u/py-mini-racer/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-_rx6y13t-record/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/wq/include/site/python3.6/py-mini-racer:
    running install
    running build
    running build_py
    creating build
    creating build/lib.freebsd-10.4-RELEASE-p9-amd64-3.6
    creating build/lib.freebsd-10.4-RELEASE-p9-amd64-3.6/py_mini_racer
    copying py_mini_racer/py_mini_racer.py -> build/lib.freebsd-10.4-RELEASE-p9-amd64-3.6/py_mini_racer
    copying py_mini_racer/__init__.py -> build/lib.freebsd-10.4-RELEASE-p9-amd64-3.6/py_mini_racer
    creating build/lib.freebsd-10.4-RELEASE-p9-amd64-3.6/py_mini_racer/extension
    copying py_mini_racer/extension/v8_build.py -> build/lib.freebsd-10.4-RELEASE-p9-amd64-3.6/py_mini_racer/extension
    copying py_mini_racer/extension/__init__.py -> build/lib.freebsd-10.4-RELEASE-p9-amd64-3.6/py_mini_racer/extension
    running egg_info
    writing py_mini_racer.egg-info/PKG-INFO
    writing dependency_links to py_mini_racer.egg-info/dependency_links.txt
    writing top-level names to py_mini_racer.egg-info/top_level.txt
    reading manifest file 'py_mini_racer.egg-info/SOURCES.txt'
    reading manifest template 'MANIFEST.in'
    warning: no previously-included files matching '__pycache__' found under directory '*'
    warning: no previously-included files matching '*.py[co]' found under directory '*'
    writing manifest file 'py_mini_racer.egg-info/SOURCES.txt'
    copying py_mini_racer/extension/mini_racer_extension.cc -> build/lib.freebsd-10.4-RELEASE-p9-amd64-3.6/py_mini_racer/extension
    running build_ext
    running build_v8
    cloning depot tools submodule
    Initialized empty Git repository in /tmp/pip-build-4d1f5b6u/py-mini-racer/.git/
    Cloning into 'vendor/depot_tools'...
    building v8
    DEBUG:py_mini_racer.extension.v8_build:Calling: 'fetch v8' from working directory /tmp/pip-build-4d1f5b6u/py-mini-racer/py_mini_racer/extension/v8
      File "/tmp/pip-build-4d1f5b6u/py-mini-racer/vendor/depot_tools/fetch.py", line 65
        print 'Running: %s' % (' '.join(pipes.quote(x) for x in cmd))
                          ^
    SyntaxError: invalid syntax
    Traceback (most recent call last):
      File "/tmp/pip-build-4d1f5b6u/py-mini-racer/setup.py", line 159, in build_extension
        self.run_command('build_v8')
      File "/usr/local/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/tmp/pip-build-4d1f5b6u/py-mini-racer/setup.py", line 205, in run
        build_v8(target)
      File "/tmp/pip-build-4d1f5b6u/py-mini-racer/py_mini_racer/extension/v8_build.py", line 161, in build_v8
        ensure_v8_src()
      File "/tmp/pip-build-4d1f5b6u/py-mini-racer/py_mini_racer/extension/v8_build.py", line 61, in ensure_v8_src
        fetch_v8(path)
      File "/tmp/pip-build-4d1f5b6u/py-mini-racer/py_mini_racer/extension/v8_build.py", line 73, in fetch_v8
        call("fetch v8")
      File "/tmp/pip-build-4d1f5b6u/py-mini-racer/py_mini_racer/extension/v8_build.py", line 36, in call
        return subprocess.check_call(cmd, shell=True, env=current_env)
      File "/usr/local/lib/python3.6/subprocess.py", line 291, in check_call
        raise CalledProcessError(retcode, cmd)
    subprocess.CalledProcessError: Command 'fetch v8' returned non-zero exit status 1.
    
    During handling of the above exception, another exception occurred:
    
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-4d1f5b6u/py-mini-racer/setup.py", line 246, in <module>
        'build_v8': MiniRacerBuildV8,
      File "/usr/local/wq/lib/python3.6/site-packages/setuptools/__init__.py", line 129, in setup
        return distutils.core.setup(**attrs)
      File "/usr/local/lib/python3.6/distutils/core.py", line 148, in setup
        dist.run_commands()
      File "/usr/local/lib/python3.6/distutils/dist.py", line 955, in run_commands
        self.run_command(cmd)
      File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/local/wq/lib/python3.6/site-packages/setuptools/command/install.py", line 61, in run
        return orig.install.run(self)
      File "/usr/local/lib/python3.6/distutils/command/install.py", line 545, in run
        self.run_command('build')
      File "/usr/local/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/local/lib/python3.6/distutils/command/build.py", line 135, in run
        self.run_command(cmd_name)
      File "/usr/local/lib/python3.6/distutils/cmd.py", line 313, in run_command
        self.distribution.run_command(command)
      File "/usr/local/lib/python3.6/distutils/dist.py", line 974, in run_command
        cmd_obj.run()
      File "/usr/local/wq/lib/python3.6/site-packages/setuptools/command/build_ext.py", line 78, in run
        _build_ext.run(self)
      File "/usr/local/lib/python3.6/distutils/command/build_ext.py", line 339, in run
        self.build_extensions()
      File "/usr/local/lib/python3.6/distutils/command/build_ext.py", line 448, in build_extensions
        self._build_extensions_serial()
      File "/usr/local/lib/python3.6/distutils/command/build_ext.py", line 473, in _build_extensions_serial
        self.build_extension(ext)
      File "/tmp/pip-build-4d1f5b6u/py-mini-racer/setup.py", line 176, in build_extension
        raise Exception(err_msg % repr(e))
    Exception: py_mini_racer failed to build, ensure you have an up-to-date pip (>= 8.1) to use the wheel instead
                To update pip: 'pip install -U pip'
                See also: https://github.com/sqreen/PyMiniRacer#binary-builds-availability
    
                Original error: CalledProcessError(1, 'fetch v8')
    
    ----------------------------------------
Command "/usr/local/wq/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-4d1f5b6u/py-mini-racer/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /tmp/pip-_rx6y13t-record/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/wq/include/site/python3.6/py-mini-racer" failed with error code 1 in /tmp/pip-build-4d1f5b6u/py-mini-racer/

System configuration

PyMiniRacer version: Tested with 0.1.10 to 0.1.15 Python version: 3.6.5 I tried to run the pip installation process from within csh as well as bash, all within the Python 3.6.5 virtual environment. I am sure I am missing something silly…

Thank you for any ideas or suggestions! Chris

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:1
  • Comments:8 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
Congeecommented, Jul 9, 2018

That syntax error is apparently caused by python2

0reactions
Moutixcommented, Sep 27, 2018

@CodingWithErik You should be able to run it without issues in all the supported platform (we provide wheel for that) This issues appears only if you try to build yourself PyMiniRacer, or we don’t have generated the build for your platform

Read more comments on GitHub >

github_iconTop Results From Across the Web

py-mini-racer 0.6.0
Add error message when py_mini_racer sdist fails to build asking to update pip in order to download the pre-compiled wheel instead of the...
Read more >
How to install modules with PIP (and fix it when it fails)
How to use PIP. Installing modules to python is painfully easy. Simply open up your terminal: Windows — Command Prompt (CMD); MacOS —...
Read more >
ModuleNotFoundError: No module named 'py-mini-racer'
pip install py-mini-racer. After the installation of py-mini-racer python library, ModuleNotFoundError: No module named 'py-mini-racer' error will be solved ...
Read more >
py-mini-racer
code:: bash $ pip install py-mini-racer Build ----- **Warning**: building this package from source takes several GB of disk space and takes ~60 ......
Read more >
How to Install Pip on Windows
Click to install Python's standard package manager, Pip, on Windows and ... with running Python tools like pip is the “not on PATH”...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found