milahu / nur-packages

my nix packages
https://nur.nix-community.org/repos/milahu/
MIT License
7 stars 0 forks source link

selenium_driverless import issues #6

Closed Titaniumtown closed 1 month ago

Titaniumtown commented 1 month ago

It seems that your build of selenium_driverless does not work because it fails to access cdp_socket.

  File "/nix/store/bi1kklgsq3h490cph1cfqdpjid1rad9l-python3-3.11.9-env/lib/python3.11/site-packages/selenium_driverless/webdriver.py", line 38, in <module>
    import cdp_socket.exceptions
ModuleNotFoundError: No module named 'cdp_socket'
milahu commented 1 month ago

works for me, because cdp-socket is in propagatedBuildInputs in pkgs/python3/pkgs/selenium-driverless/selenium-driverless.nix

$ NIXPKGS_ALLOW_UNFREE=1 nix-shell -p nur.repos.milahu.python3.pkgs.selenium-driverless
$ python -m asyncio
>>> import selenium_driverless.webdriver
>>> opt = selenium_driverless.webdriver.ChromeOptions()
>>> drv = selenium_driverless.webdriver.Chrome(opt)
>>> ctx = await drv.__aenter__()
>>> await ctx.get("https://github.com/")

seems like you did

PYTHONPATH=$(NIXPKGS_ALLOW_UNFREE=1 nix-build '<nixpkgs>' -A nur.repos.milahu.python3.pkgs.selenium-driverless)/lib/python3.11/site-packages python

which only adds selenium_driverless to sys.path

note that this is an older version of selenium_driverless works for me ; )

Titaniumtown commented 1 month ago

huh- ok. I'll just use a distrobox of archlinux in it to do my python stuff. ty for your hard work!