Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9031343
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T07:42:34+00:00 2026-06-16T07:42:34+00:00

Running cimport cython or cimport numpy in the Python interpreter results in the following

  • 0

Running cimport cython or cimport numpy in the Python interpreter results in the following error:

cimport cython
  File "<interactive input>", line 1
    cimport cython
                 ^
SyntaxError: invalid syntax

Is it environment variables path problem? Or is it not supposed to be run in the interpreter? Please, help. I spent several days trying to get rid of the error.
(By the way, I do not get an error when compiling .pyx files that use cimport numpy…)
Thank you!
Oleg

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-16T07:42:35+00:00Added an answer on June 16, 2026 at 7:42 am

    Cython is a superset of the Python language; it is not a Python module. It has a very similar syntax to Python, but adds additional syntax and functionality that is not compatible with standard Python interpreters, such as CPython (which is probably what you’re using). Cython produces C or C++ code that can be compiled into a module that can be imported into CPython.

    You need to compile your Cython program before you run it. See the documentation here:
    http://docs.cython.org/src/quickstart/build.html

    Once you have compiled your module, you don’t need to cimport it – just do a regular import. The cimport command is not recognised by CPython, hence your SyntaxError.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Running the following line in my script gives me a Permission denied error: $config_out
Running into the following error in MySQL. I have tried using convert as well
Running the code bellow, I'm getting this error: Traceback (most recent call last): File
Running my script through Devel::NYTProf showed that the following portion of code took up
Running the following program on gcc (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 and Intel(R) Core(TM)2 Duo CPU,
Running rails 3.2.3 with guard/spork/rspec/factory_girl and have the following in my spec helper: Spork.prefork
I got the following error when compiling sip with --arch x86_64 option. prosseek:siplib smcho$
Running this command in the mongodb installation file from mongodb.org ./mongo ds045907.mongolab.com:45907/database -u user
On my ubuntu server I run the following command: python -c 'import os; os.kill(5555,
Running this: bcp MyDb.dbo.uvwMyView out c:\Test.txt -SMyServer -T -c I get this error: SQLState

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.