# ImportError: cannot import name 'SimpleSpec' from 'semantic\_version'

**URL:** <https://discuss.pennylane.ai/t/importerror-cannot-import-name-simplespec-from-semantic-version/2382>\
**Category:** PennyLane Help\
**Created:** [December 14, 2022, 6:15am UTC](https://discuss.pennylane.ai/t/importerror-cannot-import-name-simplespec-from-semantic-version/2382 "2022-12-14T06:15:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![shuhul](https://avatars.discourse-cdn.com/v4/letter/s/90ced4/32.png) [@shuhul](https://discuss.pennylane.ai/u/shuhul)\
**Post date:** [December 14, 2022, 6:15am UTC](https://discuss.pennylane.ai/t/importerror-cannot-import-name-simplespec-from-semantic-version/2382/1 "2022-12-14T06:15:35Z")

</div>

I have been using pennylane for quantum circuit building, but while compiling I am getting the following error:

```auto
Traceback (most recent call last):
  File "/home/shuhul.handoo/shuhul/code/train.py", line 2, in <module>
    from models import build_generator, build_discriminator
  File "/home/shuhul.handoo/shuhul/code/models.py", line 9, in <module>
    from penn import quantum_layr
  File "/home/shuhul.handoo/shuhul/code/penn.py", line 1, in <module>
    import pennylane as qml
  File "/home/shuhul.handoo/anaconda3/lib/python3.9/site-packages/pennylane/ __init__.py", line 25, in <module>
    from semantic_version import SimpleSpec, Version
ImportError: cannot import name 'SimpleSpec' from 'semantic_version' (/home/shuhul.handoo/anaconda3/lib/python3.9/site-packages/semantic_version/ __init__.py)

```

First I thought this was error with installing Pennylane using `pip` but after installing pennylane using the command `conda install -c conda-forge pennylane` I still get this error. What should be done?

---

<div class="post-metadata">

**Author:** ![CatalinaAlbornoz](https://yyz2.discourse-cdn.com/flex012/user_avatar/discuss.pennylane.ai/catalinaalbornoz/32/1196_2.png) [@CatalinaAlbornoz](https://discuss.pennylane.ai/u/CatalinaAlbornoz)\
**Post date:** [December 21, 2022, 2:23pm UTC](https://discuss.pennylane.ai/t/importerror-cannot-import-name-simplespec-from-semantic-version/2382/2 "2022-12-21T14:23:35Z")

</div>

Hi @shuhul, welcome to the forum!

I do think this is an installation issue. Please try creating a new environment following the step-by-step below:

Create a new conda environment with:  
`conda create --name name_of_your_environment python=3.9`  
Activate the environment:  
`conda activate name_of_your_environment`  
After this you can install the needed packages:  
`python -m pip install pennylane`

Please let me know if this works for you!
