Relative Import Error with no known parent package
E
Equipe GameGratis
started a topic
about 4 years ago
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
E
Equipe GameGratis
said
about 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..
Equipe GameGratis
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.
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
- Oldest First
- Popular
- Newest First
Sorted by Oldest Firstnestor
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
Equipe GameGratis
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
-
Unable to select Scrapy project in GitHub
-
ScrapyCloud can't call spider?
-
Unhandled error in Deferred
-
Item API - Filtering
-
newbie to web scraping but need data from zillow
-
ValueError: Invalid control character
-
Cancelling account
-
Best Practices
-
Beautifulsoup with ScrapingHub
-
Delete a project in ScrapingHub
See all 453 topics