Title: Py.Import("numpy") error:Original error was: cannot import name 'Sequence' from 'collections' (D:\ProgramData\anaconda3\Lib\collections\__init__.py) · Issue #2506 · pythonnet/pythonnet · GitHub
Open Graph Title: Py.Import("numpy") error:Original error was: cannot import name 'Sequence' from 'collections' (D:\ProgramData\anaconda3\Lib\collections\__init__.py) · Issue #2506 · pythonnet/pythonnet
X Title: Py.Import("numpy") error:Original error was: cannot import name 'Sequence' from 'collections' (D:\ProgramData\anaconda3\Lib\collections\__init__.py) · Issue #2506 · pythonnet/pythonnet
Description: Environment win11 python 3.10.9 Details string pathToVirtualEnv = "D:\ProgramData\anaconda3"; Environment.SetEnvironmentVariable("PATH", pathToVirtualEnv, EnvironmentVariableTarget.Process); Environment.SetEnvironmentVariable("PYTHONHOME...
Open Graph Description: Environment win11 python 3.10.9 Details string pathToVirtualEnv = "D:\ProgramData\anaconda3"; Environment.SetEnvironmentVariable("PATH", pathToVirtualEnv, EnvironmentVariableTarget.Process); Enviro...
X Description: Environment win11 python 3.10.9 Details string pathToVirtualEnv = "D:\ProgramData\anaconda3"; Environment.SetEnvironmentVariable("PATH", pathToVirtualEnv, EnvironmentVariableTar...
Opengraph URL: https://github.com/pythonnet/pythonnet/issues/2506
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Py.Import(\"numpy\") error:Original error was: cannot import name 'Sequence' from 'collections' (D:\\ProgramData\\anaconda3\\Lib\\collections\\__init__.py)","articleBody":"### Environment\r\n \r\nwin11\r\npython 3.10.9\r\n### Details\r\n \r\n string pathToVirtualEnv = \"D:\\\\ProgramData\\\\anaconda3\";\r\n Environment.SetEnvironmentVariable(\"PATH\", pathToVirtualEnv, EnvironmentVariableTarget.Process);\r\n Environment.SetEnvironmentVariable(\"PYTHONHOME\", pathToVirtualEnv, EnvironmentVariableTarget.Process);\r\n Environment.SetEnvironmentVariable(\"PYTHONPATH\", $\"{pathToVirtualEnv}\\\\Lib\\\\site-packages;{pathToVirtualEnv}\\\\Lib\", EnvironmentVariableTarget.Process);\r\n\r\n Runtime.PythonDLL =$\"{pathToVirtualEnv}\\\\python310.dll\";\r\n PythonEngine.PythonHome = pathToVirtualEnv;\r\n PythonEngine.PythonPath = $@\"D:\\ProgramData\\anaconda3\" +\r\n $@\";D:\\ProgramData\\anaconda3\\Lib\\site-packages\" +\r\n $@\";D:\\ProgramData\\anaconda3\\Lib;\"; \r\n PythonEngine.Initialize();\r\n using (Py.GIL())\r\n {\r\n \r\n dynamic np = Py.Import(\"numpy\");《---------------------------\r\n Console.WriteLine(np.cos(np.pi * 2));\r\n \r\n }\r\n\r\nerror:\r\nPython.Runtime.PythonException:“\r\n\r\nIMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!\r\n\r\nImporting the numpy C-extensions failed. This error can happen for\r\nmany reasons, often due to issues with your setup or how NumPy was\r\ninstalled.\r\n\r\nWe have compiled some common reasons and troubleshooting tips at:\r\n\r\n https://numpy.org/devdocs/user/troubleshooting-importerror.html\r\n\r\nPlease note and check the following:\r\n\r\n * The Python version is: Python3.10 from \"C:\\Users\\ufona\\Desktop\\WindowsFormsApp1\\WindowsFormsApp1\\bin\\x64\\Debug\\WindowsFormsApp1.exe\"\r\n * The NumPy version is: \"1.23.5\"\r\n\r\nand make sure that they are the versions you expect.\r\nPlease carefully study the documentation linked above for further help.\r\n\r\nOriginal error was: cannot import name 'Sequence' from 'collections' (D:\\ProgramData\\anaconda3\\Lib\\collections\\__init__.py)\r\n”","author":{"url":"https://github.com/vc815","@type":"Person","name":"vc815"},"datePublished":"2024-11-09T07:15:49.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/2506/pythonnet/issues/2506"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:205db65c-89a8-bbbe-0f56-ecabf1ca1ee6 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 84F2:36ED6F:24CFD85:30DDC98:6971BE14 |
| html-safe-nonce | 7f70784cfbcebf40658e1a8c263576bb74764702010c4dc06dcc826569d7b8c1 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NEYyOjM2RUQ2RjoyNENGRDg1OjMwRERDOTg6Njk3MUJFMTQiLCJ2aXNpdG9yX2lkIjoiNzEzOTE3NDg2MjU3OTQxNjU5NyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 3a89776d9c1eefb3c7ee8f1e1ff4edf059b7f8b8f662f7d48cd1934ba82938a6 |
| hovercard-subject-tag | issue:2645737265 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/pythonnet/pythonnet/2506/issue_layout |
| twitter:image | https://opengraph.githubassets.com/42a41314926c05574b4bda0c55d2b7803d8cc2c4756abdcc7635e531481e2520/pythonnet/pythonnet/issues/2506 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/42a41314926c05574b4bda0c55d2b7803d8cc2c4756abdcc7635e531481e2520/pythonnet/pythonnet/issues/2506 |
| og:image:alt | Environment win11 python 3.10.9 Details string pathToVirtualEnv = "D:\ProgramData\anaconda3"; Environment.SetEnvironmentVariable("PATH", pathToVirtualEnv, EnvironmentVariableTarget.Process); Enviro... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | vc815 |
| hostname | github.com |
| expected-hostname | github.com |
| None | c3b677fea7de290a6c0d1c9ccd6c9909b6a527cf8ee079649e09dc78092d24f1 |
| turbo-cache-control | no-preview |
| go-import | github.com/pythonnet/pythonnet git https://github.com/pythonnet/pythonnet.git |
| octolytics-dimension-user_id | 6050430 |
| octolytics-dimension-user_login | pythonnet |
| octolytics-dimension-repository_id | 14748123 |
| octolytics-dimension-repository_nwo | pythonnet/pythonnet |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 14748123 |
| octolytics-dimension-repository_network_root_nwo | pythonnet/pythonnet |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 29d7fcca69cafb91ec8a596aaf222fd46e9bc934 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width