diff --git a/CHANGELOG.md b/CHANGELOG.md
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,11 @@
+## 0.2.1.2
+
+- Support megaparsec >= 9.0.0 [#25](https://github.com/egison/egison-pattern-src/issues/25)
+
+## 0.2.1.1
+
+- Relax version upper bound for prettyprinter and recursion-scheme.
+
 ## 0.2.1.0
 
 - Fix use of external parsers to delimit input with `,`, `)`, or `]`
diff --git a/egison-pattern-src.cabal b/egison-pattern-src.cabal
--- a/egison-pattern-src.cabal
+++ b/egison-pattern-src.cabal
@@ -1,6 +1,6 @@
 cabal-version:      2.0
 name:               egison-pattern-src
-version:            0.2.1.1
+version:            0.2.1.2
 synopsis:
   Manipulating Egison patterns: abstract syntax, parser, and pretty-printer
 
@@ -34,11 +34,11 @@
       base                >=4.8   && <5
     , containers          >=0.5.4 && <0.7
     , free                >=5.0.1 && <5.2
-    , megaparsec          >=7.0.0 && <8.1
+    , megaparsec          >=7.0.0 && <10.0
     , mtl                 ^>=2.2.1
     , parser-combinators  >=1.0.0 && <1.3
-    , prettyprinter       >=1.0.0
-    , recursion-schemes   >=5.2
+    , prettyprinter       >=1.0.0 && <2.0
+    , recursion-schemes   >=5.0.2 && <5.3
     , text                >=0.1.0 && <1.3
 
   hs-source-dirs:     src
diff --git a/src/Language/Egison/Parser/Pattern/Prim/Error.hs b/src/Language/Egison/Parser/Pattern/Prim/Error.hs
--- a/src/Language/Egison/Parser/Pattern/Prim/Error.hs
+++ b/src/Language/Egison/Parser/Pattern/Prim/Error.hs
@@ -1,3 +1,4 @@
+{-# LANGUAGE CPP                  #-}
 {-# LANGUAGE UndecidableInstances #-}
 
 -- |
@@ -43,6 +44,9 @@
                                                 , ErrorItem(..)
                                                 , ErrorFancy(..)
                                                 , SourcePos
+#if MIN_VERSION_megaparsec(9,0,0)
+                                                , TraversableStream (..)
+#endif
                                                 , ParseError(..)
                                                 , ParseErrorBundle(..)
                                                 , attachSourcePos
@@ -126,7 +130,11 @@
 
 -- | Convert 'Parsec.ParseErrorBundle' to 'Errors'.
 fromParseErrorBundle
+#if MIN_VERSION_megaparsec(9,0,0)
+  :: Parsec.TraversableStream s => Parsec.ParseErrorBundle s (CustomError s) -> Errors s
+#else
   :: Parsec.Stream s => Parsec.ParseErrorBundle s (CustomError s) -> Errors s
+#endif
 fromParseErrorBundle Parsec.ParseErrorBundle { Parsec.bundleErrors = errors, Parsec.bundlePosState = posState }
   = fmap makeError errorsWithPos
  where
diff --git a/src/Language/Egison/Parser/Pattern/Prim/Location.hs b/src/Language/Egison/Parser/Pattern/Prim/Location.hs
--- a/src/Language/Egison/Parser/Pattern/Prim/Location.hs
+++ b/src/Language/Egison/Parser/Pattern/Prim/Location.hs
@@ -1,3 +1,5 @@
+{-# LANGUAGE CPP #-}
+
 -- |
 --
 -- Module:      Language.Egison.Parser.Pattern.Prim.Location
@@ -5,6 +7,7 @@
 -- Stability:   experimental
 --
 -- A helper module to handle source code locations during parsing.
+
 
 module Language.Egison.Parser.Pattern.Prim.Location
   ( Location(..)
diff --git a/src/Language/Egison/Parser/Pattern/Prim/Parse.hs b/src/Language/Egison/Parser/Pattern/Prim/Parse.hs
--- a/src/Language/Egison/Parser/Pattern/Prim/Parse.hs
+++ b/src/Language/Egison/Parser/Pattern/Prim/Parse.hs
@@ -29,8 +29,12 @@
                                                 , PosState(..)
                                                 )
 import qualified Text.Megaparsec               as Parsec
-                                                ( Stream
-                                                , State(..)
+                                                ( State(..)
+#if MIN_VERSION_megaparsec(9,0,0)
+                                                , TraversableStream(..)
+#else
+                                                , Stream(..)
+#endif
                                                 , PosState(..)
                                                 , runParser'
                                                 , initialPos
@@ -59,7 +63,11 @@
   deriving newtype (MonadReader (ParseMode n v e s))
   deriving newtype (MonadParsec (CustomError s) s)
 
+#if MIN_VERSION_megaparsec(9,0,0)
+instance Parsec.TraversableStream s => Locate (Parse n v e s) where
+#else
 instance Parsec.Stream s => Locate (Parse n v e s) where
+#endif
   getPosition = fromSourcePos <$> Parsec.getSourcePos
 
 
diff --git a/src/Language/Egison/Parser/Pattern/Prim/Source.hs b/src/Language/Egison/Parser/Pattern/Prim/Source.hs
--- a/src/Language/Egison/Parser/Pattern/Prim/Source.hs
+++ b/src/Language/Egison/Parser/Pattern/Prim/Source.hs
@@ -1,4 +1,5 @@
 {-# LANGUAGE AllowAmbiguousTypes #-}
+{-# LANGUAGE CPP                 #-}
 
 -- |
 --
@@ -22,7 +23,11 @@
                                                 , snoc
                                                 )
 import qualified Text.Megaparsec               as Parsec
-                                                ( Stream(..) )
+                                                ( Stream(..)
+#if MIN_VERSION_megaparsec(9,0,0)
+                                                , TraversableStream(..)
+#endif
+                                                )
 
 import           Language.Egison.Parser.Pattern.Token
                                                 ( IsToken )
@@ -36,7 +41,11 @@
 
 -- | Constraint for the source of parser.
 -- TODO: Hide these methods in haddock (see haskell/haddock#330)
+#if MIN_VERSION_megaparsec(9,0,0)
+class (Parsec.TraversableStream s, IsToken (Token s)) => Source s where
+#else
 class (Parsec.Stream s, IsToken (Token s)) => Source s where
+#endif
   -- | Check if the stream is null or not.
   eof :: s -> Bool
   -- | Reify the input stream into a chunk of tokens.
