1

I am trying to save the packages and versions used in my python project. I installed pipreqs but I don't know why it's not working. Maybe I'm not using it correctly. What I did is the following in my jupyter notebook:

pipreqs C:\Users\Documents\myproject\gitlab\Scripts\packages

When I run it, it says syntax error. I tried replacing path = r'C:\Users\Documents\myproject\gitlab\Scripts\packages' and it still didn't work. I want the requirements.txt to be saved in this directory. Am I missing something? Can someone please guide me through how pipreqs works ? Thanks

1 Answers1

0

Under windows, running pipreqs with normal windows paths work, eg

pipreqs.exe c:\MyProject

Works as requested, using python 3.7.8 and pipreqs 0.4.10.

The syntax error comes from one of your scripts, which pipreqs actually loads. You should try to run your scripts one by one to find which of them is having the syntax error.

Good luck.

Orsiris de Jong
  • 2,819
  • 1
  • 26
  • 48
  • Thank you for your answer. What I did is that I ran my script in jupyter notebooks. Then I added this line of code, everytime I use pipreqs C:\Users\Documents\myproject\gitlab\Scripts\packages it doesn't work. I don't know if it is applicable in jupyter notebooks I barely find documentations about it. Any clue what should I do ? – Aboudi Shukor Jul 13 '20 at 13:53
  • Sorry, not familiar withy jupyter. I guess it runs with IronPython instead of CPython interpreter, which might simply not be 100% compatyible with pipreqs. Have you tried running pipreqs with a standard CPython interpreter ? – Orsiris de Jong Jul 13 '20 at 19:10
  • I think the problem is with jupyter. It doesn't work not sure why. Anyways, thank you very much for your help. – Aboudi Shukor Jul 14 '20 at 07:42