-
-
Notifications
You must be signed in to change notification settings - Fork 88
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
SandboxViolation #101
Comments
Could you indicate what command led to this error? Am I right in thinking you are running on M1? |
I am running on M1. python3 -m pip install kiwisolver. I was able to install to venv and copy files over. The issue seems to be specific to the native python 3.8. |
Hi, I Just got this M1 Mac and am having the same issue installing kiwisolver. My unix chops could use some help, is there a post detailing the above workaround? Or is there any information I could provide to help resolve this issue? |
Hi all, I have the same problem with Apple M1, and the workaround for me is downgrade to version 1.1, via (under venv)
Hope it's helpful. I am guessing it's a change of build method from 1.1 to 1.2 + Apple M1 change of some system package privileges. |
Thanks @tyc85 for the update regarding the absence of issue in 1.1. I will try to have a look at what may have caused it. Once we can build wheels on M1 hopefully things will get better. |
Seeing this issue on an intel mac with big sur as well for what it's worth. |
Looking at the changelog the difference between 1.1 and 1.2, the key differences:
Could anybody able to reproduce the issue see if any of the following change anything ?
|
Also @darakian do you see this for the system Python or a different interpreter ? |
Never mind. I thought I was using brew, but it looks like it is the system python |
Let me know if you see the same with brew, @nrcharles believe it is only on the system Python and I would like to get a cross check. |
Made a new venv with the brew python 3.9 and I'm still seeing it. Slightly sanitized output follows
|
That's different from the originally reported error. Do you see the same after installing wheel ? I may have to be more specific in the setup_requires but it is annoying that setuptools try to use wheel but does not ensure it is present. |
You're right. So, my main project uses poetry to resolve dependencies and as far as I can tell the issue is poetry specific. Still investigating. I'll post again if I can get a minimal example going. Edit: Edit the second:
In a fresh venv with brew python 3.9.1 a call to |
At this point I feel like blaming poetry for not providing wheels to a project using setuptools. May be worth asking over there. |
Will do. Thanks :) |
Getting sandbox violation in virtualenv, python 3.8 and Big Sur 11.2.3 with version >= 1.2.0. Downgrading to 1.1.0 circumvents this issue. Package is required by matplotlib.
Let me know if more information is needed. |
Do you install from source or using a wheel ? Related questions, are you on Apple M1, and is this for the system Python ? Just want to know how similar it is to earlier reports. |
Oh, right. MacBook Pro 16” 2019 so Intel and wheel. I’ve been getting this for issue for another package. Can’t recall which right now. However there it was hinted the python needs be reinstalled. Could it be that python installation has been corrupted somehow? |
Thanks. This is all quite confusing to me and since I do not have access to a Mac. Could you post the traceback you get ? |
I had to run with the --no-cache option since it seems kiwi 1.1.0, which I previously rolled back to, probably satisfied any requirements by Matplotlib or perhaps in turn numpy. That part considered the error looks the same to me. Here are the relevant parts of lxml==4.6.2
flake8==3.9.0
luigi==3.0.2
numpy==1.20.1
# kiwisolver==1.1.0
matplotlib==3.4.0 Here goes:
-Best of luck! |
What MacOS X version are you running ? This is quite confusing since the wheel for MacOS for Python 3.8 is available at https://pypi.org/project/kiwisolver/1.3.1/#files so I really don't get why your system is trying to build from source. Also could you try to clone the repo and manually build a wheel ? If you get the same error try to install cppy using pip (a bunch of c++ headers needed only at build time) first, maybe macOS dislike setup_requires. I would like to see the name of the produced wheel to get an idea of why the one on PyPI is not picked up. |
Big Sur 11.2.3. So it’s a later major version. Maybe that plays a part. Moreover, the distro probably also supports the M1 chip, although I’m running Intel. Yeah, I could give it a try. But in a few days, I’m a little busy over the holidays. |
From this issue (pypa/pip#9138), it appears that updating pip should fix the issue by accepting the wheels built for MacOS 10.9 on Big Sur (that is 11.x). Hopefully that is the only step you need to take to solve the issue. |
Ok, i’ll start with that then. |
Sorry, I cannot upgrade pip since I unfortunately depend on Python 2.7 support. But I can confirm there are a lot of things building on my OS. Especially, numpy breaks while building similar to the issue reported for pip. |
I am not sure to follow why you cannot upgrade the pip used by your Python 3.8 install. It should not affect what pip is used by Python 2.7 (except if MacOS is doing something funky here). |
Ok, maybe I’ll give a go then, in a few days time. Unfortunately busy at the moment. |
I can reproduce it on:
So using latest pip doesn't help, however this is M1-specific. No such problems on an Intel Mac (which uses a prebuilt wheel). |
@weakcamel Could you test the M1 wheel (see #102 (comment)) and see if it fixes the issue ? If they work I will upload them to PyPI. |
@MatthieuDartiailh yep, it installs just fine:
Not sure how to test it more TBH, I use kiwisolver as a dependency of a dependency. |
You can clone the repo and run the test suite using pytest from inside the repositroy: Thanks for testing. |
Ah, hang on - the Homebrew Python slipped in during the previous test. All clear with latest pip and Python3.8 anyway: % pip install -i https://pypi.anaconda.org/multibuild-wheels-staging/simple kiwisolver
Looking in indexes: https://pypi.anaconda.org/multibuild-wheels-staging/simple
Collecting kiwisolver
Downloading https://pypi.anaconda.org/multibuild-wheels-staging/simple/kiwisolver/1.3.1/kiwisolver-1.3.1-cp38-cp38-macosx_11_0_arm64.whl (59 kB)
|████████████████████████████████| 59 kB 351 kB/s
Installing collected packages: kiwisolver
Successfully installed kiwisolver-1.3.1
(.venv) % pytest py/tests
========================================================================================== test session starts ===========================================================================================
platform darwin -- Python 3.8.2, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /Users/foouser/kiwi
collected 49 items
py/tests/test_constraint.py ........ [ 16%]
py/tests/test_expression.py ............ [ 40%]
py/tests/test_solver.py ........ [ 57%]
py/tests/test_strength.py .. [ 61%]
py/tests/test_term.py ............ [ 85%]
py/tests/test_variable.py ....... [100%]
=========================================================================================== 49 passed in 0.21s ===========================================================================================
'Objective\n---------\n + 2 * e2 + 1 * s8 + -2 * s10\n\nTableau\n-------\nv1 | + 1 * s10\ne3 | + 1 * e2 + -1 * s10\nv4 | + -1 * d5 + -1 * s10\ns6 | + -1 * s10\ne9 | + 1 * s8 + -1 * s10\n\nInfeasible\n----------\ne3\ne9\n\nVariables\n---------\nbar = v1\nfoo = v4\n\nEdit Variables\n--------------\nbar\n\nConstraints\n-----------\n1 * bar + -0 >= 0 | strength = 1\n1 * bar + 0 == 0 | strength = 1\n1 * bar + 1 <= 0 | strength = 1.001e+09\n1 * bar + 1 * foo + 0 == 0 | strength = 1.001e+09\n\n\n'%
(.venv) kiwi % Thank you! Both for the wheel and the blazingly fast response :-) |
Happy to help. I will do my best to push the M1 wheel on PyPI in the coming days. |
The M1 wheels are now live ! @weakcamel since you reported that you did not observe the issue on Intel Mac and that the wheels are fine on M1 I will close this since I have no idea how to workaround the limitation Mac set up with respect to the OS interpreter when it comes to compilation. |
On Big Sur:
Darwin Mac-mini.local 20.1.0 Darwin Kernel Version 20.1.0: Sat Oct 31 00:07:10 PDT 2020; root:xnu-7195.50.7~2/RELEASE_ARM64_T8101 arm64
Hit the following error.
Processing /usr/local/src/kiwi
ERROR: Command errored out with exit status 1:
command: /Library/Developer/CommandLineTools/usr/bin/python3 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/private/var/folders/v7/p9qpjc0x773clsj_15lm34ch0000gn/T/pip-req-build-9u3hos4b/setup.py'"'"'; file='"'"'/private/var/folders/v7/p9qpjc0x773clsj_15lm34ch0000gn/T/pip-req-build-9u3hos4b/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(file);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, file, '"'"'exec'"'"'))' egg_info --egg-base /private/var/folders/v7/p9qpjc0x773clsj_15lm34ch0000gn/T/pip-pip-egg-info-_w5wpn5d
cwd: /private/var/folders/v7/p9qpjc0x773clsj_15lm34ch0000gn/T/pip-req-build-9u3hos4b/
Complete output (166 lines):
warning: no files found matching '*.png' under directory 'docs/source'
no previously-included directories found matching '.git'
no previously-included directories found matching 'dist'
no previously-included directories found matching 'build'
no previously-included directories found matching 'docs/build'
Traceback (most recent call last):
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/distutils/core.py", line 148, in setup
dist.run_commands()
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 966, in run_commands
self.run_command(cmd)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/command/bdist_egg.py", line 172, in run
cmd = self.call_command('install_lib', warn_dir=0)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/command/bdist_egg.py", line 158, in call_command
self.run_command(cmdname)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/distutils/cmd.py", line 313, in run_command
self.distribution.run_command(command)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/distutils/dist.py", line 985, in run_command
cmd_obj.run()
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/command/install_lib.py", line 15, in run
self.byte_compile(outfiles)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/distutils/command/install_lib.py", line 132, in byte_compile
byte_compile(files, optimize=0,
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/distutils/util.py", line 466, in byte_compile
compile(file, cfile, dfile)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/py_compile.py", line 157, in compile
os.makedirs(dirname)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/os.py", line 213, in makedirs
makedirs(head, exist_ok=exist_ok)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/os.py", line 213, in makedirs
makedirs(head, exist_ok=exist_ok)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/os.py", line 213, in makedirs
makedirs(head, exist_ok=exist_ok)
[Previous line repeated 2 more times]
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/os.py", line 223, in makedirs
mkdir(name, mode)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/sandbox.py", line 310, in wrap
path = self._remap_input(name, path, *args, **kw)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/sandbox.py", line 452, in _remap_input
self._violation(operation, os.path.realpath(path), *args, **kw)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.8/lib/python3.8/site-packages/setuptools/sandbox.py", line 407, in _violation
raise SandboxViolation(operation, args, kw)
setuptools.sandbox.SandboxViolation: SandboxViolation: mkdir('/Users/Nathan/Library/Caches/com.apple.python/private/var/folders/v7/p9qpjc0x773clsj_15lm34ch0000gn/T/easy_install-gw_yrbny', 511) {}
The text was updated successfully, but these errors were encountered: