0

I am a bit lost. I've just recently started working with python and have been able to use other libraries, that I've imported without any issues.

  1. Install via pip command
  2. Restart Visual Studio Community 2019
  3. I can use the library

Now I wanted to import the docx2pdf library. But using the same 3 steps is not working and I don't know what to do.

from docx2pdf import convert <-- gets the error "unresolved import"

Also: after installing it via pip I get the following message in addition to the installation being a success:

WARNING: The script docx2pdf.exe is installed in 'C:\Users\user\AppData\Roaming\Python\Python37\Scripts' which is not on PATH. Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.

I didn't get this message from other libraries.

I am using windows 10.

Thanks for the help!

Alex
  • 23
  • 5
  • https://stackoverflow.com/questions/53939751/pylint-unresolved-import-error-in-visual-studio-code? – ForceBru Feb 04 '21 at 12:59
  • Hey @ForceBru, this is not really working for me, since I don't have a command interface... and I can't seem to the workspace-settings in VS Community. – Alex Feb 04 '21 at 13:16

1 Answers1

0

In VS Code, when we use the global python environment to install the module, we can use the command "pip show docx2pdf" to check its storage location is: "\users\username\appdata\local\programs\python\python38\lib\ site-packages"

enter image description here

It is recommended that you reinstall the module "docx2pdf" or try to delete the previously installed "docx2pdf" folder and reinstall it.

enter image description here

Run:

enter image description here

Jill Cheng
  • 9,179
  • 1
  • 20
  • 25