Python library "NLTK"

Problems with the Windows version of XAMPP, questions, comments, and anything related.

Python library "NLTK"

Postby stanislav » 19. April 2022 12:42

Hi guys! I need to use python library named "NLTK" on XAMPP. But as i found, NLTK "has platform-specific path handling"(https://stackoverflow.com/questions/16609242/import-nltk-not-working-on-xampp) and Apache does not provide the proper environment(https://stackoverflow.com/questions/11219319/appdata-is-not-returned-in-python-executed-via-cgi).
I hardly looked at the documentation and links above:
1) https://httpd.apache.org/docs/current/env.html
2) https://httpd.apache.org/docs/current/mod/mod_env.html#setenv
3) https://httpd.apache.org/docs/current/howto/cgi.html
"If your CGI program depends on non-standard environment variables, you will need to assure that those variables are passed by Apache." Thanks, very 'helpful'. I cant understand HOW and WHERE exactly I need to do env. fixes.
My configuration: Apache/2.4.53 (Win64) OpenSSL/1.1.1n PHP/7.4.28 Server at localhost Port 80
I would be very grateful, if you give step-by-step instruction.

P.S. Sorry for bad english.
stanislav
 
Posts: 4
Joined: 19. April 2022 12:35
XAMPP version: 7.4.28
Operating System: Windows

Re: Python library "NLTK"

Postby gsmith » 19. April 2022 21:20

PassEnv APPDATA

Put it in httpd.conf if you want it available in all virtualhosts or inside any virtualhost you want APPDATA available for
gsmith
 
Posts: 278
Joined: 29. November 2013 18:04
Location: San Diego
XAMPP version: 0.0.0
Operating System: Win 10/2012R VS 14,15,16

Re: Python library "NLTK"

Postby stanislav » 21. April 2022 09:31

Thank you, very much, gsmith! It helped! Problem solved!
stanislav
 
Posts: 4
Joined: 19. April 2022 12:35
XAMPP version: 7.4.28
Operating System: Windows


Return to XAMPP for Windows

Who is online

Users browsing this forum: No registered users and 90 guests

cron