Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Runtime Parse Error When Using Semantic Kernel In Python Project #8022

Open
vsfeedback opened this issue Oct 9, 2024 · 4 comments
Open

Runtime Parse Error When Using Semantic Kernel In Python Project #8022

vsfeedback opened this issue Oct 9, 2024 · 4 comments
Assignees

Comments

@vsfeedback
Copy link

This issue has been moved from a ticket on Developer Community.


[severity:I'm unable to use this version]
I am trying to use Semantic Kernel in a Visual Studio 2022 Python project but I get the following runtime exception:
(7, [('expected', 'letter or digit', None)]) at the line import semantic_kernel.

Steps to reproduce the error:

  1. Create new Python Project
  2. Add 'import semantic_kernel'
  3. Run the application

Application stops with the exception:
(7, [('expected', 'letter or digit', None)])

I am using Python verion 3.9 (64-bit) and semantic-kernel (0.9.6b1)

Further details in Output:
Stack trace:

File "C:\pymeta_generated_code\pymeta_grammar__Grammar.py", line 259, in _G_many_2 (Current frame)
_G_apply_1, lastError = self._apply(self.rule_letterOrDigit, "letterOrDigit", [])
File "C:\pymeta_generated_code\pymeta_grammar__Grammar.py", line 262, in rule_name
_G_many_3, lastError = self.many(_G_many_2)
File "C:\pymeta_generated_code\pymeta_grammar__Grammar.py", line 604, in _G_lookahead_2
_G_apply_1, lastError = self._apply(self.rule_name, "name", [])
File "C:\pymeta_generated_code\pymeta_grammar__Grammar.py", line 608, in rule_rule
_G_lookahead_3, lastError = self.lookahead(_G_lookahead_2)
File "C:\pymeta_generated_code\pymeta_grammar__Grammar.py", line 641, in _G_many_1
_G_apply_1, lastError = self._apply(self.rule_rule, "rule", [])
File "C:\pymeta_generated_code\pymeta_grammar__Grammar.py", line 644, in rule_grammar
_G_many_2, lastError = self.many(_G_many_1)
File "C:\VSProjects\PythonApplication2\PythonApplication2\PythonApplication2.py", line 1, in
import semantic_kernel
pymeta.runtime.ParseError: (7, [('expected', 'letter or digit', None)])


Original Comments

Feedback Bot on 10/8/2024, 10:46 AM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.

@StellaHuang95
Copy link
Contributor

Thanks for reaching out. Is your code in a public repo or could you provide code samples that help us repro this issue? Thanks!

@GDT48
Copy link

GDT48 commented Nov 6, 2024

@StellaHuang95
Copy link
Contributor

Thanks! I don’t see your environment included in the repo, and I wasn’t able to repro the issue. Based on the error message, it seems like a compatibility issue with the semantic-kernel package’s dependency on pymeta. Could you try updating or reinstalling both semantic-kernel and pymeta? You might also want to run the script outside of Visual Studio to check if it’s specific to the IDE

@GDT48
Copy link

GDT48 commented Nov 7, 2024

I have updated and tidied the project, creating an environment.
The environment has 'semantic-kernel==0.9.6b1'.
However if I run with from semantic-kernel import KernelI get error - invalid syntax, because of the hyphan.
If I edit to to from semantic_kernel import Kernel I get the exception - (7, [('expected', 'letter or digit', None)])

Note the inconsistency between semantic-kernel (with a hyphan) and semantic_kernel (with an underscore).

I am able to create a Python project with semantic_kernel in VS Code without issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants