Import pyrevit in pycharm

Hello ! I’ve tried a lot of things to import Pyrevit in pycharm in order to work with the API and nothing has worked yet.
Adding pyrevit and Revit folders to Project Structure and them mark them as Source didn’t fix anything, do you have any solutions in order to make this work ?
I’m still having this as an output to my code
Thanks a lot

After importing pyrevitlib in the Project Structure, I can run the code yet the error is this one now :

pyRevit doesn’t work outside of Revit environment. It makes calls into the Revit API which is not available when Revit is not loaded

How can I proceed then ? Use a PythonRevitShell ?

Yes you can add pyRevit’s library path to RevitPythonShell and import it there

Worked perfectly, thanks a lot for your help and your time !

1 Like