简体   繁体   中英

Having trouble running/installing camelcase

I am trying to run camelCase and install it the code I used for installing it is

   C:\Users\Your Name\AppData\Local\Programs\Python\Python36-32\Scripts>pip install camelcase

which gave me the result of

   C:\\Users\\Your Name\\AppData\\Local\\Programs\\Python\\Python36-32\\Scripts>pip install camelcase

which made me think it installed it but when I tried to import camelCase using import camelCase it gave me the result of

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
ModuleNotFoundError: No module named 'camelcase'

(I have Python 3.8.3 BTW so it already has PIP)

Import the camelcase package using lowercase letters. As an example:

from camelcase import CamelCase
c = CamelCase()
s = 'this is a sentence that needs camelcasing!'
print(c.hump(s))

I have had the same problem. To solve this in windows:

  1. Find where the project interpreter is located, for example in Pycharm you can find it here:Settings\Project:<project_name>\Python Interpreter
  2. Open cmd and active the same pass.
  3. Try to install your package in that pass by using: pip install

That may solve the problem.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM