Skip to content
Advertisement

Use external packages in eth-brownie?

I am trying open a ERC721 smart contract in Brownie on VSCode and loop through the token ids and set the URI of each in each iteration. I execute the script with brownie run scripts/parcel_asset/testpyodbc.py. I am trying to use an ODBC driver named pyodbc to query an Access database and create a cursor to iterate. It works fine when running as just a python script but Brownie gives a error ModuleNotFoundError: No module named 'pyodbc'. Is there a way to his odbc with Brownie?

Below is the error I get

JavaScript

Advertisement

Answer

I found this on a Discord channel: brownie is installed to its own virtual environment, if you want other packages to work you have to “inject” them into the brownie virtualenv: When using brownie I can’t use external modules, pip install doesn’t work brownie but full disclosure, i tried this for another package i was working with to no avail.

JavaScript

This fixed the problem

Advertisement