ishaga-bello / short-quote-video-creator

A small python code that will automatically create a 1 minute quote video
5 stars 0 forks source link

AttributeError: 'NoneType' object has no attribute 'get' #1

Open Thrqureshi opened 1 year ago

Thrqureshi commented 1 year ago

I am getting this error when trying to run main.py

AttributeError: 'NoneType' object has no attribute 'get'

Is there any instruction on how to run this script

Thrqureshi commented 1 year ago

error

(env) C:\Users\User\Desktop\Python\short-quote-video-creator>main.py Traceback (most recent call last): File "C:\Users\User\Desktop\Python\short-quote-video-creator\main.py", line 17, in create_image(term) File "C:\Users\User\Desktop\Python\short-quote-video-creator\textOnImage.py", line 61, in create_image image_dict = imageGraber.image_graber(term) File "C:\Users\User\Desktop\Python\short-quote-video-creator\imageGraber.py", line 25, in imagegraber photos = pu.photos(type='random', count=number_of_image, featured=True, query=term, orientation='portrait') File "C:\Users\User\Desktop\Python\short-quote-video-creator\env\lib\site-packages\pyunsplash\pyunsplash.py", line 52, in photos return f(api_key=self._api_key, kwargs) File "C:\Users\User\Desktop\Python\short-quote-video-creator\env\lib\site-packages\pyunsplash\src\photos.py", line 46, in init super(RandomPhotos, self).init(url=url, api_key=api_key, valid_options=valid_options, kwargs) File "C:\Users\User\Desktop\Python\short-quote-video-creator\env\lib\site-packages\pyunsplash\src\unpage.py", line 47, in init r = self._agent.get(self.url, self.query_parameters) AttributeError: 'NoneType' object has no attribute 'get'

(env) C:\Users\User\Desktop\Python\short-quote-video-creator>

ishaga-bello commented 1 year ago

hey @Thrqureshi sorry for the late reply, the issue is surely that you did not create an unsplash API key, checkout this guide how to get an unsplash api key for more help and then create a file named ".env" in your root directory.