Hello, Nestor helped me a lot earlier to deploy my project, but now I have another problem, this time with running custom scripts and importing spiders and other scripts with relative import.
I searched already but didn't find any topic talking about this. It's taking so much time for me to find a workaround so I please help me.
Basically they need to be declared in your setup.py
0 Votes
2 Comments
Sorted by
E
Equipe GameGratisposted
over 4 years ago
Hi, thank you for response. As I said before, I managed to put everything in setup.py file, and configuring the project like this. I even copied the import process from 'monitor'.py onscrapy_price_monitor example.
I am trying a lot of different 'solutions' but after deploy correctly and run, it happens this problem with Relative Import Error with no known parent package... I really need some help now..
Hello, Nestor helped me a lot earlier to deploy my project, but now I have another problem, this time with running custom scripts and importing spiders and other scripts with relative import.
I searched already but didn't find any topic talking about this. It's taking so much time for me to find a workaround so I please help me.
My project is structured like this:
After deploying, I try to run 'rodar_ps42.py', code:
Then the 'callps42' function call the spider through '.spider_results' like this:
The 'spider_results' returns the spider results to 'dados' variable, and then the function continues to post the results to my database.
My problem is, when I run 'rodar_ps42.py' at Scrapy Cloud, the following Import Error appears:
Searched about this issue, tried to move the project around, removed some __init__.py files, but nothing worked.
I managed to put everything in setup.py file, and configuring the project like this.
I also looked at scrapy_price_monitor example and copied the import process from 'monitor'.py ... but then it does not find the module:
What do I need to do? Can't find anything about it, anywhere. If needed I can post more of my project.
Thank you so much.
0 Votes
nestor posted over 4 years ago Admin Best Answer
Hi, to import custom python scripts into your project please follow this guide: https://support.scrapinghub.com/support/solutions/articles/22000200394-running-custom-python-scripts
Basically they need to be declared in your setup.py
0 Votes
2 Comments
Equipe GameGratis posted over 4 years ago
Hi, thank you for response. As I said before, I managed to put everything in setup.py file, and configuring the project like this. I even copied the import process from 'monitor'.py on scrapy_price_monitor example.
I am trying a lot of different 'solutions' but after deploy correctly and run, it happens this problem with Relative Import Error with no known parent package... I really need some help now..
Thank you for everything
0 Votes
nestor posted over 4 years ago Admin Answer
Hi, to import custom python scripts into your project please follow this guide: https://support.scrapinghub.com/support/solutions/articles/22000200394-running-custom-python-scripts
Basically they need to be declared in your setup.py
0 Votes
Login to post a comment