N
N
Nikolai2021-01-16 15:38:58
Python
Nikolai, 2021-01-16 15:38:58

Trouble installing some pip [Errno29], what can I do?

Hello. I have the following problem, while installing a number of pip, an error appears [Errno29], below is an example for two packages

spoiler

pip install ips.py
Collecting ips.py
  Downloading https://files.pythonhosted.org/packages/b8/76/441bff94f9fe852bed1c4e1e7d5c7535704b04dc88de218e41e49bea2678/ips.py-0.1.2-py3-none-any.whl
Installing collected packages: ips.py
Successfully installed ips.py-0.1.2
You are using pip version 18.1, however version 20.3.3 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Enter the package name:
Pillow
pip install Pillow
Collecting Pillow
  Downloading https://files.pythonhosted.org/packages/73/59/3192bb3bc554ccbd678bdb32993928cb566dccf32f65dac65ac7e89eb311/Pillow-8.1.0.tar.gz (44.9MB)
    100% |████████████████████████████████| 44.9MB 73kB/s 
Fatal Python error: _Py_InitializeCore: main interpreter already initialized

Thread 0x0000000172a53000 (most recent call first):
  File "~/Python3/Lib/subprocess.py", line 1430 in _execute_child
  File "~/Python3/Lib/subprocess.py", line 756 in __init__
  File "~/lib/python3.7/site-packages/pip/_internal/utils/misc.py", line 659 in call_subprocess
  File "~/lib/python3.7/site-packages/pip/_internal/req/req_install.py", line 473 in run_egg_info
  File "~/lib/python3.7/site-packages/pip/_internal/operations/prepare.py", line 126 in prep_for_dist
  File "~/lib/python3.7/site-packages/pip/_internal/operations/prepare.py", line 298 in prepare_linked_requirement
  File "~/lib/python3.7/site-packages/pip/_internal/resolve.py", line 209 in _get_abstract_dist_for
  File "~/lib/python3.7/site-packages/pip/_internal/resolve.py", line 256 in _resolve_one
  File "~/lib/python3.7/site-packages/pip/_internal/resolve.py", line 102 in resolve
  File "~/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 318 in run
  File "~/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 143 in main
  File "~/lib/python3.7/site-packages/pip/_internal/__init__.py", line 78 in main
  File "~/bin/pip", line 11 in <module>
Program aborted.
    Error [Errno 29] Illegal seek: '~/Python3/bin/python.c' while executing command python setup.py egg_info
Could not install packages due to an EnvironmentError: [Errno 29] Illegal seek: '~/Python3/bin/python.c'


pip install lz4
Collecting lz4
  Downloading https://files.pythonhosted.org/packages/f4/ed/f6225b24e13597eb39abaa7d2e23c8fd70f5b1478db1e3dd5a5ac0f5011f/lz4-3.1.2.tar.gz (153kB)
     |████████████████████████████████| 163kB 2.3MB/s 
Program aborted.
    ERROR: Error [Errno 29] Illegal seek: '~/Python3/bin/python.c' while executing command python setup.py egg_info
ERROR: Could not install packages due to an EnvironmentError: [Errno 29] Illegal seek: '~/Python3/bin/python.c'


Python 3.7
Pip 19.2.3
setuptools 51.1.2 I
carry out the actions in the program on ios Mobile C [ C / C ++ Compiler ] https://rocld.com/narp6 , and therefore I can’t update the python (if someone tells you how to do this for this mobile program, then I will be VERY grateful). I can update Pip to 20.3.3, but then when installing any package in general, this appears
spoiler

ERROR: Exception:
Traceback (most recent call last):
  File "~/lib/python3.7/site-packages/pip/_vendor/resolvelib/resolvers.py", line 171, in _merge_into_criterion
    crit = self.state.criteria[name]
KeyError: 'pyusb'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "~/lib/python3.7/site-packages/pip/_internal/cli/base_command.py", line 224, in _main
    status = self.run(options, args)
  File "~/lib/python3.7/site-packages/pip/_internal/cli/req_command.py", line 180, in wrapper
    return func(self, options, args)
  File "~/lib/python3.7/site-packages/pip/_internal/commands/install.py", line 321, in run
    reqs, check_supported_wheels=not options.target_dir
  File "~/lib/python3.7/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 122, in resolve
    requirements, max_rounds=try_to_avoid_resolution_too_deep,
  File "~/lib/python3.7/site-packages/pip/_vendor/resolvelib/resolvers.py", line 445, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "~/lib/python3.7/site-packages/pip/_vendor/resolvelib/resolvers.py", line 310, in resolve
    name, crit = self._merge_into_criterion(r, parent=None)
  File "~/lib/python3.7/site-packages/pip/_vendor/resolvelib/resolvers.py", line 173, in _merge_into_criterion
    crit = Criterion.from_requirement(self._p, requirement, parent)
  File "~/lib/python3.7/site-packages/pip/_vendor/resolvelib/resolvers.py", line 82, in from_requirement
    if not cands:
  File "~/lib/python3.7/site-packages/pip/_vendor/resolvelib/structs.py", line 124, in __bool__
    return bool(self._sequence)
  File "~/lib/python3.7/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 96, in __bool__
    return any(self)
  File "~/lib/python3.7/site-packages/pip/_internal/resolution/resolvelib/found_candidates.py", line 20, in _deduplicated_by_version
    for candidate in candidates:
  File "~/lib/python3.7/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 200, in iter_index_candidates
    hashes=hashes,
  File "~/lib/python3.7/site-packages/pip/_internal/index/package_finder.py", line 882, in find_best_candidate
    candidates = self.find_all_candidates(project_name)
  File "~/lib/python3.7/site-packages/pip/_internal/index/package_finder.py", line 826, in find_all_candidates
    project_url, link_evaluator=link_evaluator,
  File "~/lib/python3.7/site-packages/pip/_internal/index/package_finder.py", line 789, in process_project_url
    html_page = self._link_collector.fetch_page(project_url)
  File "~/lib/python3.7/site-packages/pip/_internal/index/collector.py", line 618, in fetch_page
    return _get_html_page(location, session=self.session)
  File "~/lib/python3.7/site-packages/pip/_internal/index/collector.py", line 430, in _get_html_page
    resp = _get_html_response(url, session=session)
  File "~/lib/python3.7/site-packages/pip/_internal/index/collector.py", line 144, in _get_html_response
    "Cache-Control": "max-age=0",
  File "~/lib/python3.7/site-packages/pip/_vendor/requests/sessions.py", line 555, in get
    return self.request('GET', url, **kwargs)
  File "~/lib/python3.7/site-packages/pip/_internal/network/session.py", line 428, in request
    return super(PipSession, self).request(method, url, *args, **kwargs)
  File "~/lib/python3.7/site-packages/pip/_vendor/requests/sessions.py", line 542, in request
    resp = self.send(prep, **send_kwargs)
  File "~/lib/python3.7/site-packages/pip/_vendor/requests/sessions.py", line 655, in send
    r = adapter.send(request, **kwargs)
  File "~/lib/python3.7/site-packages/pip/_vendor/cachecontrol/adapter.py", line 53, in send
    resp = super(CacheControlAdapter, self).send(request, **kw)
  File "~/lib/python3.7/site-packages/pip/_vendor/requests/adapters.py", line 533, in send
    return self.build_response(request, resp)
  File "~/lib/python3.7/site-packages/pip/_vendor/cachecontrol/adapter.py", line 80, in build_response
    request, response
  File "~/lib/python3.7/site-packages/pip/_vendor/cachecontrol/controller.py", line 374, in update_cached_response
    self.cache.set(cache_url, self.serializer.dumps(request, cached_response))
  File "~/lib/python3.7/site-packages/pip/_internal/network/cache.py", line 71, in set
    f.write(value)
  File "~/Python3/Lib/contextlib.py", line 119, in __exit__
    next(self.gen)
  File "~/lib/python3.7/site-packages/pip/_internal/utils/filesystem.py", line 112, in adjacent_tmp_file
    os.fsync(result.file.fileno())
AttributeError: module 'os' has no attribute 'fsync'


This error appears starting with pip version 19.3 (detected empirically). If anyone can tell me how to fix this, then I will be VERY grateful doubly .

I really count on your help. Sincerely.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
alekssamos, 2021-01-16
@alekssamos

I have another solution: https://ish.app/

apk add python3 curl
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
python3 get-pip.py

Everything installs great! Even nodejs, PHP, GO and others work! And even tox, virtualenv works! And even the tests pass, wow!
Just don't forget to install programs like git, there's nothing there by default.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question