Closed wakamex closed 6 months ago
@antazoey was experimenting a bit with using importlib
for plugin detection, but yeah I don't think the install portion of ape will work without pip
(but maybe can just detect uv and use uv pip
instead in that case)
Yeah, can you try on main branch? I think you should be able to at least list the plugins now as of https://github.com/ApeWorX/ape/pull/1996
yeah, I'm thinking if at least you can use ape and just ape plugins install
is broken, that's probably not as huge a deal for @wakamex since he should know how to install plugins himself manually via uv
so a re-install that just points to my local ape-alchemy repo (that i'm still working on!) and installs the latest requirements:
>> uv venv .venv -p 3.10
>> source .venv/bin/activate
>> uv pip install -e ../ape-alchemy
>> ape plugins list
Traceback (most recent call last):
File "/code/testape2/.venv/bin/ape", line 5, in <module>
from ape._cli import cli
File "/code/testape2/.venv/lib/python3.10/site-packages/ape/__init__.py", line 10, in <module>
from ape.managers.project import ProjectManager as Project
File "/code/testape2/.venv/lib/python3.10/site-packages/ape/managers/__init__.py", line 23, in <module>
ManagerAccessMixin.config_manager = ConfigManager(
File "/code/testape2/.venv/lib/python3.10/site-packages/pydantic/main.py", line 164, in __init__
__pydantic_self__.__pydantic_validator__.validate_python(data, self_instance=__pydantic_self__)
File "/code/testape2/.venv/lib/python3.10/site-packages/ape/managers/config.py", line 134, in load_configs
return cm.load()
File "/code/testape2/.venv/lib/python3.10/site-packages/ape/managers/config.py", line 277, in load
_ = self._plugin_configs
File "/code/testape2/.venv/lib/python3.10/site-packages/ape/managers/config.py", line 205, in _plugin_configs
valid_ecosystems = dict(self.plugin_manager.ecosystems)
File "/code/testape2/.venv/lib/python3.10/site-packages/ape/plugins/__init__.py", line 138, in __getattr__
self._register_plugins()
File "/code/testape2/.venv/lib/python3.10/site-packages/ape/plugins/__init__.py", line 193, in _register_plugins
module = importlib.import_module(module_name)
File "/usr/lib64/python3.10/importlib/__init__.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "/code/testape2/.venv/lib/python3.10/site-packages/ape_test/__init__.py", line 10, in <module>
from ape_test.provider import EthTesterProviderConfig, LocalProvider
File "/code/testape2/.venv/lib/python3.10/site-packages/ape_test/provider.py", line 7, in <module>
from eth.exceptions import HeaderNotFound
File "/code/testape2/.venv/lib/python3.10/site-packages/eth/__init__.py", line 1, in <module>
import pkg_resources
ModuleNotFoundError: No module named 'pkg_resources'
installing setuptools solves this error:
>> uv pip install setuptools
Resolved 1 package in 1ms
Installed 1 package in 32ms
+ setuptools==69.2.0
>> ape plugins list
Installed Plugins
alchemy 0.7.1.dev11+gad25ef2.d20240411
add setuptools as a dependency? if you add pip as a dependency then uv
should install it...
Environment information
ape
and plugin versions:ape-config.yaml
(NOTE: do not post anything private like RPC urls or secrets!):What went wrong?
couldn't use alchemy in my script. upon further inspection, it wasn't showing up in plugins or networks. i realized this is because of my non-standard installation with
uv
. since I don't have pip installed, it fails trying to query which plugins are installed.here are some terminal printouts:
trying to use a script that uses alchemy without pip installed fails:
How can it be fixed?
there's probably a more generic way to detect installed packages than going through pip. but it may be messy.