Skip to content
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

m1 mac 에서 requests 라이브러리 버전 문제 #10

Open
hyngsk opened this issue Sep 12, 2021 · 0 comments
Open

m1 mac 에서 requests 라이브러리 버전 문제 #10

hyngsk opened this issue Sep 12, 2021 · 0 comments

Comments

@hyngsk
Copy link

hyngsk commented Sep 12, 2021

m1 맥에서 아래와 같은 코드 실행 시 오류가 납니다.

import upbitpy

upbit = upbitpy.Upbitpy()
print(upbit.get_minutes_candles(15,'KRW-BTC'))

에러는 다음과 같습니다.

ERROR:root:Cannot allocate write+execute memory for ffi.callback(). You might be running on a system that prevents this. For more information, see https://cffi.readthedocs.io/en/latest/using.html#callbacks
Traceback (most recent call last):
  File "/Users/hyngsk/miniforge3/envs/tf/lib/python3.9/site-packages/upbitpy/upbitpy.py", line 529, in _load_markets
    market_all = self.get_market_all()
  File "/Users/hyngsk/miniforge3/envs/tf/lib/python3.9/site-packages/upbitpy/upbitpy.py", line 295, in get_market_all
    return self._get(URL)
  File "/Users/hyngsk/miniforge3/envs/tf/lib/python3.9/site-packages/upbitpy/upbitpy.py", line 494, in _get
    resp = requests.get(url, headers=headers, data=data, params=params)
  File "/Users/hyngsk/miniforge3/envs/tf/lib/python3.9/site-packages/requests/api.py", line 75, in get
    return request('get', url, params=params, **kwargs)
  File "/Users/hyngsk/miniforge3/envs/tf/lib/python3.9/site-packages/requests/api.py", line 60, in request
    return session.request(method=method, url=url, **kwargs)
  File "/Users/hyngsk/miniforge3/envs/tf/lib/python3.9/site-packages/requests/sessions.py", line 533, in request
    resp = self.send(prep, **send_kwargs)
  File "/Users/hyngsk/miniforge3/envs/tf/lib/python3.9/site-packages/requests/sessions.py", line 646, in send
    r = adapter.send(request, **kwargs)
  File "/Users/hyngsk/miniforge3/envs/tf/lib/python3.9/site-packages/requests/adapters.py", line 439, in send
    resp = conn.urlopen(
  File "/Users/hyngsk/miniforge3/envs/tf/lib/python3.9/site-packages/urllib3/connectionpool.py", line 597, in urlopen
    httplib_response = self._make_request(conn, method, url,
  File "/Users/hyngsk/miniforge3/envs/tf/lib/python3.9/site-packages/urllib3/connectionpool.py", line 343, in _make_request
    self._validate_conn(conn)
  File "/Users/hyngsk/miniforge3/envs/tf/lib/python3.9/site-packages/urllib3/connectionpool.py", line 839, in _validate_conn
    conn.connect()
  File "/Users/hyngsk/miniforge3/envs/tf/lib/python3.9/site-packages/urllib3/connection.py", line 330, in connect
    self.ssl_context = create_urllib3_context(
  File "/Users/hyngsk/miniforge3/envs/tf/lib/python3.9/site-packages/urllib3/util/ssl_.py", line 281, in create_urllib3_context
    context.verify_mode = cert_reqs
  File "/Users/hyngsk/miniforge3/envs/tf/lib/python3.9/site-packages/urllib3/contrib/pyopenssl.py", line 413, in verify_mode
    self._ctx.set_verify(
  File "/Users/hyngsk/miniforge3/envs/tf/lib/python3.9/site-packages/OpenSSL/SSL.py", line 1028, in set_verify
    self._verify_helper = _VerifyHelper(callback)
  File "/Users/hyngsk/miniforge3/envs/tf/lib/python3.9/site-packages/OpenSSL/SSL.py", line 331, in __init__
    self.callback = _ffi.callback(
MemoryError: Cannot allocate write+execute memory for ffi.callback(). You might be running on a system that prevents this. For more information, see https://cffi.readthedocs.io/en/latest/using.html#callbacks

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/Users/hyngsk/PycharmProjects/deepredicML/test.py", line 4, in <module>
    upbit = upbitpy.Upbitpy()
  File "/Users/hyngsk/miniforge3/envs/tf/lib/python3.9/site-packages/upbitpy/upbitpy.py", line 27, in __init__
    self.markets = self._load_markets()
  File "/Users/hyngsk/miniforge3/envs/tf/lib/python3.9/site-packages/upbitpy/upbitpy.py", line 538, in _load_markets
    raise Exception(e)
Exception: Cannot allocate write+execute memory for ffi.callback(). You might be running on a system that prevents this. For more information, see https://cffi.readthedocs.io/en/latest/using.html#callbacks

Process finished with exit code 1

i fixed the problem like #11

hyngsk added a commit to hyngsk/upbitpy that referenced this issue Sep 12, 2021
modified 'requests' library install_requires version in setup.py
'requests==2.21.0' to 'requests>=2.21.0'

the error fixed in 'requests==2.26.0'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant