Код: Выделить всё
import sys
import os
sys.path.insert(1, os.path.expanduser("path2otherProjectDirectory"))
from otherProjectDirectory import foo
Я понял, что setup.py несколько устарел (и это сама по себе длинная история), и я не уверен, что создание колеса поможет редактируемые пакеты. Также pip пытается построить зависимости, используя источники в Интернете. Дело в том, что машина находится за брандмауэром. Я могу устанавливать пакеты через PyCharm, потому что прокси-сервер настроен, но я не могу ничего получить, используя тот же прокси-сервер:
Код: Выделить всё
pip install -e /path/to/utils/ --proxy 10.1.2.3:1234
Код: Выделить всё
Installing build dependencies ... error
error: subprocess-exited-with-error
× pip subprocess to install build dependencies did not run successfully.
│ exit code: 1
╰─> [7 lines of output]
WARNING: Retrying (Retry(total=4, connect=None, read=None, redirect=None, status=None)) after connection broken by 'NewConnectionError('
: Failed to establish a new connection: [Errno 11001] getaddrinfo failed')': /simple/setuptools/
Код: Выделить всё
pip install -e --no-index --find-links /path/to/utils/
pip install -e /path/to/utils/ --no-index
Код: Выделить всё
ERROR: Could not find version that satisfies the requirement setuptools>=40.8.0 (frim version: none)
ERROR: No matching distribution found for setuptools>=40.8.0
Я также пробовал установить пакет как редактируемый с несколькими пакетами с одним и тем же модулем верхнего уровня, что нарушает импорт.
Я использую Windows 10, Python 3.13 и инструменты настройки 75.4.0.
Подробнее здесь: https://stackoverflow.com/questions/791 ... ne-offline