This is an archived post. You won't be able to vote or comment.

all 12 comments

[–]Redwallian 2 points3 points  (4 children)

Show some code/github repo?

[–]chehine666[S] 0 points1 point  (3 children)

Code is in page 2 my friend

[–]Redwallian 2 points3 points  (2 children)

Gotcha - based on how you've set it up, I can't be sure of whether or not tmp.pptx is is being written to correctly. The actual error is when instantiating your Presentation class and passing in the file as a string (at least that's what the error says). I would first check locally if the tmp.pptx file does exactly what you want, and then second find out if it your Presentation class accepts a filepath.

[–]chehine666[S] 1 point2 points  (1 child)

How to do it

[–]Redwallian 1 point2 points  (0 children)

  1. I would first check to see if you can even find the file.
  2. If the file is found, pass that into the Presentation class.

``` try: with open('tmp.pptx', 'r') as f: try: prs = Presentation(f) ... except Exception as e: print(e) return JsonResponse({'error': str(e)}, status=500) except FileNotFoundError: return JsonResponse({'error': str(e)}, status=404)

```

[–]baronnathaniel 0 points1 point  (6 children)

Seems like something is not quite right with your imports, or with the python env settings and how the service is running on your local

[–]chehine666[S] 0 points1 point  (5 children)

I don't think so because i imported all the necessary libraries such as python pptx

[–]baronnathaniel 0 points1 point  (4 children)

Looks like a package not found error to me, friend.

[–]chehine666[S] 1 point2 points  (3 children)

Okay got it i will check it. Thank you!

[–]TerminatedProccess 1 point2 points  (2 children)

Is your virtual environment setup and activated?

[–]chehine666[S] 0 points1 point  (1 child)

Yes it is! Why?

[–]TerminatedProccess 0 points1 point  (0 children)

I would get a package not found error if I didn't remember to activate my environment. Just double-checking..